how to check if item is visible or not ?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Posts: 21
Joined: Thu Feb 23, 2012 3:06 pm

how to check if item is visible or not ?

Post by Dyshar » Thu May 31, 2012 12:52 pm

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 ?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11736
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Thu May 31, 2012 2:38 pm


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.

Ranorex Support Team