I have heard this one many times, and to be honest there are edge cases where it is the only way to make that click work. But I personally try to use that approach as the latest source and here is why...
I got a message from a customer today saying: 'Hey marketing can't save new components on the page, they are saying that there is no save button'.
So I opened my email to check the automated tests and they were all Passed. 100% success. At this point I started to think that it was most likely a glitch on the system. So I started testing manually and found out that the
save icon was indeed missing.
But then.. how did my tests didn't find this issue? This is a flow that all the tests go through, that means I should have had hundreds of failures.
So I opened the code and.. found the problem right away...
This is one of those cases where the bug is 100% test case proof, or in different words I had useless tests.
For this specific case, the element does exist on the page.
WebDriver error. Failed Authoring: Component: phonenumber
Failure Reason: org.openqa.selenium.ElementNotInteractableException: element not interactable.
Remember that every single action on the script should behave as a validation. Clicking, typing, selecting.. if one of those fail you got yourself a problem in the website this is a continues validation approach that would help your tests being more reliable and avoid false positives. (like in my story).
But we should try to avoid it, cause it is not a real user flow.
cheers :) and remember to keep using webdriver
if you liked the post: