Hi,
Anyone know if there is anyway to find only the visible descendants on screen and not all descendants?
Anyway to find only visible descendants?
Re: Anyway to find only visible descendants?
Hello
Not sure about what you are asking but if I understood correctly you can use the "Visible" attribute.
Let's say I want all the visible buttons in the form titled "MyForm"
/form[@title='MyForm']/button[@visible='True']
Again not sure it's what you are asking.
Have a nice day
Boris
Not sure about what you are asking but if I understood correctly you can use the "Visible" attribute.
Let's say I want all the visible buttons in the form titled "MyForm"
/form[@title='MyForm']/button[@visible='True']
Again not sure it's what you are asking.
Have a nice day
Boris
A simple thank you always does wonders !
Re: Anyway to find only visible descendants?
Hi Boris,
Thanks for the reply.
I guess i wasnt clear enough.
Ex:
I wana find all the visible descendant object for one table, lets say of this specific table there are 20 buttons, but only 5 are visible on screen.
To get all the buttons i use :
IList <ButtonTag> buttonTags = repo.testWebsite.tdTable.FindDescendants<ButtonTag>();
What i wonder is can i somehow tell "FindDescendants" to only give me all visible buttons?
Reason for FindDescendants, is that for ex that table has several rows as chid and the buttons are inside the rows etc.
Is it possible to find the buttons from the table like you suggested?
ex: /form[@title='MyForm']/tdTable/button[@visible='True']??
/Feroz
Thanks for the reply.
I guess i wasnt clear enough.
Ex:
I wana find all the visible descendant object for one table, lets say of this specific table there are 20 buttons, but only 5 are visible on screen.
To get all the buttons i use :
IList <ButtonTag> buttonTags = repo.testWebsite.tdTable.FindDescendants<ButtonTag>();
What i wonder is can i somehow tell "FindDescendants" to only give me all visible buttons?
Reason for FindDescendants, is that for ex that table has several rows as chid and the buttons are inside the rows etc.
Is it possible to find the buttons from the table like you suggested?
ex: /form[@title='MyForm']/tdTable/button[@visible='True']??
/Feroz
Re: Anyway to find only visible descendants?
Okay now I get it
After looking a bit around I found this post http://www.ranorex.com/forum/identifyin ... t1280.html
The only argument you can pass in FindDescendants is (defaultlabel) which isn't explained that much in the documentation (http://www.ranorex.com/Documentation/Ra ... s__1_1.htm)
You could try using FindSingle for which you can use a RxPath as parameter :
http://www.ranorex.com/Documentation/Ra ... gle__1.htm
The RxPath synthax to target descendants is ".//" by the way.
Hope you can figure it out.
Boris
After looking a bit around I found this post http://www.ranorex.com/forum/identifyin ... t1280.html
The only argument you can pass in FindDescendants is (defaultlabel) which isn't explained that much in the documentation (http://www.ranorex.com/Documentation/Ra ... s__1_1.htm)
You could try using FindSingle for which you can use a RxPath as parameter :
http://www.ranorex.com/Documentation/Ra ... gle__1.htm
The RxPath synthax to target descendants is ".//" by the way.
Hope you can figure it out.
Boris
A simple thank you always does wonders !
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Anyway to find only visible descendants?
Hello,
Please try out the following code snippet below to get only visible buttons:
Markus (T)
Please try out the following code snippet below to get only visible buttons:
IList <ButtonTag> buttonTags = repo.testWebsite.tdTable.Find<ButtonTag>(".//button[@visible='True']"); IList<Button> btns = repo.Calculator.Self.Find<Button>(".//button[@visible='True']");Regards,
Markus (T)
Re: Anyway to find only visible descendants?
Hi Markus,
It works with find
Can you tell me why it works with Find but not with FindDescendants?
Cause i thought it needed to be descendants, since the buttons are not direct children to the object.
The buttons are under Td\TR\Buttontags, but i have the TD in my repo item since there can be several TR.
Thanks for the help
/Feroz
It works with find
Can you tell me why it works with Find but not with FindDescendants?
Cause i thought it needed to be descendants, since the buttons are not direct children to the object.
The buttons are under Td\TR\Buttontags, but i have the TD in my repo item since there can be several TR.
Thanks for the help
/Feroz
Re: Anyway to find only visible descendants?
Hey.
I explained the difference in my post above.
Have a nice day
Boris
I explained the difference in my post above.
Have a nice day
Boris
A simple thank you always does wonders !
Re: Anyway to find only visible descendants?
Hi,
Sorry missed that part
Thanks Boris.
Sorry missed that part
Thanks Boris.