Click the button when it is highlighted

Ask general questions here.
ejji09
Posts: 54
Joined: Thu Sep 10, 2015 2:48 pm

Click the button when it is highlighted

Post by ejji09 » Tue Dec 08, 2015 4:51 pm

Hi,

Am using code module to test my java application. At a certain point in my application i have click a button when the button got highlighted. but ranorex clicks the button before it got highlighted and it was not able to click the button when it got highlighted after 3-4 seconds. And i can solve this issue by adding delay of 3-4 seconds, But i want to know how to click only when the button is highlighted with out adding the delay time.
2.JPG
Button when it is not highlighted
2.JPG (8.28 KiB) Viewed 503 times
1.JPG
Button when it is highlighted
1.JPG (8.36 KiB) Viewed 503 times
I want to click the button only when it is highlighted

Thank you.

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Click the button when it is highlighted

Post by stapes » Tue Dec 08, 2015 5:01 pm

You could use Image based validation to distinguish the two images.

You can also use Wait For - Exists - Highlighted Button.

Then do your click.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3908
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Click the button when it is highlighted

Post by odklizec » Wed Dec 09, 2015 8:21 am

Hi,

Another thing that might be worth a try is to check the 'Enabled' state of non-highlighted button. Is the button enabled if the button is in non-highlighted mode? If not, then you can add and @enabled='true' to the repo item xpath or wait for enabled==true in your code?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration