Automation Help with Control

Ask general questions here.
User avatar
subodh4u7
Posts: 68
Joined: Tue Jan 06, 2015 8:26 am

Automation Help with Control

Post by subodh4u7 » Wed Aug 10, 2016 7:39 am

Hello Experts,

I have below scenario:
1. Initially Button Ok is disabled, so want to verify button is disabled.
2. Once i select other item, then Button is Enabled and then want to click on that, so before clicking want to verify whether button is enabled or not.

How can i get such things to be done. I searched there is no method called WaitForEnabled or VerifyEnabled.

Can anyone please suggest someone how can i extend the ranorex method to create such method.
e.g. 1. WaitForEnabled(True/False, timeout,throwExceptionIfConditionNotMet) --> True or false decides where button is enabled or disbale

2. VerifyEnabled(True/False, String buttonInfo, timeout, throwExceptionIfConditionNotMet)

It will be great if we can develop some method for such usage which could help in automation
e.g VerifyText(String value, timeout, throwException), VerifyTextContains(String value, timeout, throwException)
Regards,
Subodh

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

Re: Automation Help with Control

Post by odklizec » Wed Aug 10, 2016 8:08 am

Hi,

In my opinion, the easiest way to achieve what you want is to add @enabled='true' to the repo element xpath. So the xpath should look something like this:
tbody//input[@type='submit' and @enabled='true']
Then you can use Validate NotExists, to validate the not existence of repo element, which meets the @enabled='true' condition. After that, you can use WaitFor Exists method, which will pause the test until the condition @enabled='true' is met. Once the button is enabled, the test should continue and in the next step you can press the button. Hope this helps?
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