10

According to the WebKit documentation for Safari 10:

"When running a WebDriver test in Safari, test execution is confined to special Automation windows that are isolated from normal browsing windows, user settings, and preferences. Automation windows are easy to recognize by their orange Smart Search field."

In that version of the browser I was able to run automation for Safari without the 'glass pane' by doing:

var webdriver = require('selenium-webdriver'),
    safari = require('selenium-webdriver/safari');
    driver = new webdriver.Builder()
    .forBrowser('safari')
    .usingServer('http://localhost:4444/wd/hub') // this previous avoided the glass pane
    .build(); 

I believe that the reason this worked was that starting the Webdriver and using the Selenium standalone server hub and SafariDriver extension allowed this for remote automation as part of Selenium Grid. It no longer seems to work in Safari 11.

The statement in the documentation:

"The automaticInspection capability will preload the Web Inspector and JavaScript debugger in the background; to pause test execution and bring up Web Inspector’s Debugger tab, you can simply evaluate a debugger; statement in the test page."

Would be useful but I take that to mean that I need to add debugging statements to the source code, which is not something QA is empowered to do in my situation.

Is there a way to use Selenium to automate testing in Safari 11 without the 'glass pane' AT ALL? Any reading I might need to do is welcomed; there are far too many problems that I am encountering when running in glass pane to make fixing each of those an efficient way forward.

2

The short answer is no.

The longer answer is I'm not 100% sure but I'm fairly confident the answer is no.

I've worked at Sauce Labs for a few years now, several of them in support. I've done a lot of hacking to try to make Safari and other Webdriven browsers play nice, and Safari has always been the most impenetrable.

Since creating SafariDriver for Safari 10, they've been improving how automation works for Safari... And I suspect they want to do it the Apple Way. Safari 11.1 and earlier still supported WebDriver 2, but from Safari 12 on it's all been WebDriver 3. I suspect that Apple made changes gradually to align Safari automation with how they think it should work.

I think your guess about why you could avoid the glass pane in previous versions is a good one; I suspect Apple didn't realise it was a possibility at first. Once they did, they removed it.

I could be wrong! It's just a hunch; We've run 3.6 billion tests and I've seen people do a lot of stuff to browsers, but I've never seen 'em break the Glass Pane without the test halting. Sorry!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.