MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

Selenium 3 says "I'm sorry but your browser is not supported" #260

Closed mvysny closed 7 years ago

mvysny commented 7 years ago

Thank you for the amazing driver, finally a driver with which Selenium simply works :-)

I tried to upgrade to Selenium 3 and unfortunately there is something really broken. The browser says, quoting:

I'm sorry, but your browser is not supported The version (38.0) of the browser you are using is outdated and not supported. You should consider upgrading to a more up-to-date browser.

A screenshot of the issue: clickbuttonshouldchangethelabel my vaadin app test myfirstit

You can easily reproduce this issue by checking out this project: https://github.com/mvysny/testbench4-starterkit tag jbrowser-error

And simply run

mvn clean verify
hollingsworthd commented 7 years ago

Thanks!

That might not be related to the Selenium 3 upgrade and could be just that the default user agent at this point needs updating. However it can be specified as such:

new JBrowserDriver(Settings.builder()
  .requestHeaders(RequestHeaders.CHROME)
  .userAgent(new UserAgent(
    UserAgent.Family.WEBKIT,
    "Google Inc.",
    "Win32",
    "Windows NT 6.1",
    "5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2869.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2869.0 Safari/537.36"))
  .build())
mvysny commented 7 years ago

Awesome, that helped, thank you!

hennr commented 7 years ago

@mvysny Would you mind closing this issue then?

mvysny commented 7 years ago

Sure, apologies. @hennr please do you know where this screen comes from? Is it perhaps rendered by JBrowserDriver, Selenium, or perhaps by the TestBench?

hennr commented 7 years ago

My guess would be the URL you got via the driver, your vaadin app most probably.