[英]Unable to launch Safari 12 browser in Mac OSX using Selenium and Java
Recently I updated mac OS to "Mojave version 10.14" and "safari version 12.0" after that i am unable to lunch safari browser.最近我将 mac OS 更新为“Mojave version 10.14”和“safari version 12.0”,之后我无法使用 safari 浏览器。 Earlier it was running fine.
早些时候它运行良好。 I am selenium "3.0.0" here is my code:
我是硒“3.0.0”这是我的代码:
Scenario 1:场景一:
case "safari":
DesiredCapabilities cap = DesiredCapabilities.safari();
driver = new SafariDriver(cap);
break;
Error:错误:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{browserName=safari, safari.options=org.openqa.selenium.safari.SafariOptions@10eff, version=, platform=MAC}], required capabilities = Capabilities [{}]
Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
System info: host: 'xxxx-MacBook-Pro.local', ip: 'xxxxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14', java.version: '1.8.0_131'
Driver info: driver.version: SafariDriver
Scenario 2:场景2:
SafariOptions options = new SafariOptions();
options.setUseTechnologyPreview(true);
WebDriver driver = new SafariDriver(options);
driver.get("http://www.google.com");
driver.quit();
Error:错误:
Exception in thread "main" org.openqa.selenium.WebDriverException: SafariDriver requires Safari 10 running on OSX El Capitan or greater.
Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
System info: host: 'xxxx-MacBook-Pro.local', ip: 'xxxxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14', java.version: '1.8.0_131'
Driver info: driver.version: SafariDriver
at org.openqa.selenium.safari.SafariDriver.getExecutor(SafariDriver.java:75)
at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:62)
In both cases i am unable to run my test cases please someone help me.在这两种情况下,我都无法运行我的测试用例,请有人帮助我。 Thanks .
谢谢 。
This error message...这个错误信息...
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{browserName=safari, safari.options=org.openqa.selenium.safari.SafariOptions@10eff, version=, platform=MAC}], required capabilities = Capabilities [{}] Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700' System info: host: 'xxxx-MacBook-Pro.local', ip: 'xxxxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14', java.version: '1.8.0_131'
...implies that the SafariDriver was unable to initiate/spawn a new WebBrowser ie Safari Browser session. ...暗示SafariDriver无法启动/生成新的WebBrowser,即Safari 浏览器会话。
Your main issue is the incompatibility between the version of the binaries you are using as follows:您的主要问题是您使用的二进制文件版本之间的不兼容,如下所示:
So there is a clear mismatch between the JDK v8u131 , Selenium Client v3.0.0所以JDK v8u131和Selenium Client v3.0.0之间存在明显的不匹配
@Test
.@Test
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.