15 March 2013

Chrome Webdriver and Coordinate Errors

If you get coordinate errors with Chrome Webdriver, the most likely culprit (that I've found) is that this is due to a UI element obstructing the view of something you are clicking.

Yes, it's weird.  Normally webdriver would say "click this ID/Name/Class" and it clicks it no matter if a window is up or not.

But with Chrome Webdriver it's a bit different.

Take the screenshot below for example:

In this test, I first had Chrome Webdriver click on that menu.  that menu stays up when webdriver runs (not in a regular Chrome session), so then when it comes time to click "Save" it will throw an exception:
Element is not clickable at point (109, 604). Other element would receive the click:
 
The trick is to get all  your UI elements back away so you can send that click.  In my Case I either don't pull that particular menu, or I click it again to close it.
 

No comments:

Post a Comment