从Java中的硒启动Safari技术浏览器

时间:2018-06-29 02:28:49

标签: java selenium safari

  SafariOptions options = new SafariOptions();
     options.setUseTechnologyPreview(true);
    System.out.println(options);
    WebDriver driver = new SafariDriver(options);
    driver.get("http://www.google.com");

我正在尝试从Mac启动Safari技术浏览器 Safari技术预览浏览器版本-版本59(Safari 12.0,WebKit 13606.1.21) Mac版本-10.13.5 Sierra Safari浏览器默认版本-版本11.1.1(13605.2.8)

我遇到以下异常-

线程“主”中的异常org.openqa.selenium.SessionNotCreatedException:无法创建会话:在系统上找不到名称为“ Safari”版本“(空)”的浏览器。 内部版本信息:版本:'3.13.0',版本:'2f0d292',时间:'2018-06-25T15:32:14.902Z' 系统信息:主机:'administrators-MacBook-Pro-4.local',ip:'fe80:0:0:0:1468:c932:b3dc:95ae%en0',操作系统名称:'Mac OS X',os .arch:'x86_64',os.version:'10 .13.5',java.version:'1.8.0_171' 驱动程序信息:driver.version:SafariDriver 远程堆栈跟踪:     在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)处     在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     在java.lang.reflect.Constructor.newInstance(Constructor.java:423)     在org.openqa.selenium.remote.W3CHandshakeResponse.lambda $ new $ 0(W3CHandshakeResponse.java:57)     在org.openqa.selenium.remote.W3CHandshakeResponse.lambda $ getResponseFunction $ 2(W3CHandshakeResponse.java:104)     在org.openqa.selenium.remote.ProtocolHandshake.lambda $ createSession $ 0(ProtocolHandshake.java:123)     在java.util.stream.ReferencePipeline $ 3 $ 1.accept(ReferencePipeline.java:193)     在java.util.Spliterators $ ArraySpliterator.tryAdvance(Spliterators.java:958)     在java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)     在java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)     在java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)     在java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)     在java.util.stream.FindOps $ FindOp.evaluateSequential(FindOps.java:152)     在java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)     在java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)     在org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)     在org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)     在org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)     在org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)     在org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)     在org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)     在org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:130)     在org.openqa.selenium.safari.SafariDriver。(SafariDriver.java:78)     在org.openqa.selenium.safari.SafariDriver。(SafariDriver.java:60)     在com.qa.test.BrowserTest.main(BrowserTest.java:33)

0 个答案:

没有答案