Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
210 views
by The go-to Tester (232 points)
retagged by
I have some test cases and i met a issue: they pass on Chrome driver 2.24 but fail on 2.22, 2.23 and 2.24.

The failure steps often relate to elements as pop up options, new pop up window, alert, etc.

Please help to show me some way to fix in realistic, and how to write code to prevent same issues in the future!

Thank you so much!
by The go-to Tester (181 points)
Can you post existing code of the element which is failed to be recognized?
by The go-to Tester (232 points)
I am sorry that i cant post code here because it belongs to client's project. So i have tried to described as clear as possible. I met this issue many times and with many kinds of elements.
 So if you have experience on this cases, you can show your main way to fix it. Not need very clear and detail.
Thanks

1 Answer

0 like 0 dislike
by The go-to Tester (181 points)
selected by
 
Best answer
I can think of one solution at this point of time. You an try using WebDriverWait and wait for that specific element. JavaScript engine of the browser gets improved with new every new version. You can try using WebDriverWait to wait for a specific element to appear. This will stabilize your automated tests to the great extent.

Let me know your views in the comment.
by The go-to Tester (232 points)
I used WebDriverWait( element enabled, displayed) and that step passed but next step, e/g: element.click() or element.send_keys() still not worked. But with time.sleep(1), it is OK.
Could you clarify it?
P/s: time.sleep could not be used because of coding standard so i have must find another solution.
by The go-to Tester (181 points)
Ok, in that case you can try WebDriverWait until the element is not clickable, not enabled or displayed. There is a difference between enabled/displayed and clickable.

Try that and let me know.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...