Click on disabled button
Click on disabled button
After making a recording, I changed the application by disabling a button that has been clicked on during the recording. When I run the test case again, it should fail when trying to click on the disabled button. However, it went on as the button is still enabled. Why? Thanks.
Re: Click on disabled button
Hi,
Unless you extend button's xpath with @enabled='True', it will try to click it regardless of enabled state. However, adding @enabled='True' to the xpath could make your script to fail in case the button remains disabled.
You will have to use a condition (via code) that Ranorex should click only enabled button. Something like this:
Unless you extend button's xpath with @enabled='True', it will try to click it regardless of enabled state. However, adding @enabled='True' to the xpath could make your script to fail in case the button remains disabled.
You will have to use a condition (via code) that Ranorex should click only enabled button. Something like this:
if (repo.yourbutton.Enabled) { repo.yourbutton.Click(); }
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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