Page 1 of 1

how to check if item is visible or not ?

Posted: Thu May 31, 2012 12:52 pm
by Dyshar
hello, i have a problem..
i have a task where can be mark "priorite". this mark is at the begining invisible and become visible after i press button "priority task" and my test should be like..

1 check that there is task withous mark
2 press button
3 check that there is task with mark

and i dont know how to do it.
i used validate text of mark or just id if exist or not, but ranorex told me all time it exist.. so how i can check if text is visible and then validation exist is true or text is invisible and then validation exist failed (adn other hand validation not exist is true when object is invisible ?

Re: how to check if item is visible or not ?

Posted: Thu May 31, 2012 2:38 pm
by Support Team
Hello,

You can validate if the specific attribute contains the specific text with "Validate- AttributeEqual/AttributeContains" and you can also check if the specific element is visible, just select the "Visible" attribute in the "Match Name" section.
You can also check the visible attribute in UserCode method "yourAdapter.Visible" or include it in your RxPath like "/button[@text='Start' and @visible='true']".
There are more ways how you can handle such things with Ranorex, if you need a more specific answer we would need more information about the structure of your Ranorex project and a Ranorex Snapshot file of the specific element.
Following link will show you how to generate a snapshot file, Creating Ranorex Snapshot Files.
I hope this will help you solve the issue.

Regards,
Markus
Ranorex Support Team