SafariDriver Cant Find Element Locations

In the newest version of SafariDriver that was shipped with Safari 12 I am seeing an issue where calling element.Location is throwing an error:

'The given key was not present in the dictionary.'


Of course this does not happen on Chrome or Firefox. What is strange is that I am able to execute click(), and SendKeys() without any issues. I would assume that both of those methods would need X and Y coordinates. Has anyone else run into this issue? I have a bug filed with Apple as well to look at the issue.

Replies

I second that. driver.findElement(By.id("myId")).getLocation(); throws null pointer in JAVA.

Hi Rob, have you found any work arounds for this? This issue essentially blocks me from using Safari as a test browser still.

Hi

You can use safari technology preview instead.

https://github.com/SeleniumHQ/selenium/issues/6637#issuecomment-438769269