With Ranorex Spy, I tracked a toolbar from Windows Explorer
/form[@title='Testvideo']/element[@class='WorkerW']/form/element[@controlid='41477']/progressbar/element/toolbar[@controlid='1001']
When I delete the controlid='1001'] and press <CNTR> + <SPACE>, list of keywords opens.
List have only "class" , "controlid" and "instance".
I need to get the attribute "Window Text"; how can I get the it? (need to know the address written in toolbar...)
Ranorex Spy & Window Text
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy & Window Text
I tried it.
It's about the control that displays the path in Windows Explorer.
When the Path Control is in edit mode I can get the text via
One would need to get the text attribute of all buttons and concatenate them in code.
Regards,
Roland
Ranorex Support Team
It's about the control that displays the path in Windows Explorer.
When the Path Control is in edit mode I can get the text via
Else via/form[@title='Snapshots']/element[@class='WorkerW']/container/element[@controlid='41477']/progressbar/combobox/text[@controlid='41477']
But this time the parts of the path are child button elements./form[@title='Snapshots']/element[@class='WorkerW']/container/element[@controlid='41477']/progressbar/element/toolbar[@controlid='1001']
has a text attribute which is the root element of the path. And so on./form[@title='Snapshots']/element[@class='WorkerW']/container/element[@controlid='41477']/progressbar/element/toolbar[@controlid='1001']/button[1]
One would need to get the text attribute of all buttons and concatenate them in code.
Regards,
Roland
Ranorex Support Team
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy & Window Text
Just as an addon to Roland's post:
Regards,
Alex
Ranorex Team
Just type in "@windowtext" or use the NativeWindow.WindowText attribute in code to access that property. Spy just does not show that attribute when hitting Ctrl+Space, since it is a volatile attribute (changing frequently) and should thus not be used in RanoreXPaths to identify elements.SanMan wrote:I need to get the attribute "Window Text"; how can I get the it? (need to know the address written in toolbar...)
Regards,
Alex
Ranorex Team
Re: Ranorex Spy & Window Text
...or use the NativeWindow.WindowText attribute in code to access that property
This one would be great.
excuse me my ignorance
How to get that property?
string path = repo.FormOpen_file.ToolBar1001 ??? .NativeWindow.WindowText; ???
----
I did it this way (got help from forum);
object value = repo.FormOpen_file.ToolBar1001;
value = repo.FormOpen_file.ToolBar1001.Element.GetAttributeValue("windowtext");
string exp_path = Ranorex.Core.ValueConverter.ToFriendlyString(value);
Is this correct way?
This one would be great.


How to get that property?
string path = repo.FormOpen_file.ToolBar1001 ??? .NativeWindow.WindowText; ???
----
I did it this way (got help from forum);
object value = repo.FormOpen_file.ToolBar1001;
value = repo.FormOpen_file.ToolBar1001.Element.GetAttributeValue("windowtext");
string exp_path = Ranorex.Core.ValueConverter.ToFriendlyString(value);
Is this correct way?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy & Window Text
Please, read the following section in the Ranorex User Guide covering that topic:SanMan wrote:How to get that property?
http://www.ranorex.com/support/user-gui ... apter.html
In your case, I recommend the following code:
Ranorex.NativeWindow nw = new Ranorex.NativeWindow(repo.FormOpen_file.ToolBar1001); string windowText = nw.WindowText;Regards,
Alex
Ranorex Team
Re: Ranorex Spy & Window Text
Thank you!
That one work perfectly!
That one work perfectly!
