如何解决硒测试套件无法访问的浏览器失败
由于这是我们应用程序的官方浏览器,最近我们已切换到在Edge上运行测试套件。 但是,切换之后,我们开始遇到以下问题
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '4.0.0-alpha-5',revision: 'b3a0d621cc'
System info: host: 'S51WDD4',ip: '10.28.8.4',os.name: 'Windows Server 2016',os.arch: 'amd64',os.version: '10.0',java.version: '1.8.0_181'
Driver info: driver.version: RemoteWebDriver
Capabilities {acceptInsecureCerts: false,browserName: msedge,browserVersion: 80.0.361.50,javascriptEnabled: true,ms:edgeOptions: {debuggerAddress: localhost:58885},msedge: {msedgedriverVersion: 80.0.361.50 (c54b8bed30dc6f...,userDataDir: C:\Users\Jenkins\AppData\Lo...},networkConnectionEnabled: false,pageLoadStrategy: normal,platform: WINDOWS,platformName: WINDOWS,proxy: Proxy(),setWindowRect: true,strictFileInteractability: false,timeouts: {implicit: 0,pageLoad: 300000,script: 30000},unhandledPromptBehavior: accept}
Session ID: af923cbb0b657356aa77087fa2557a99
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:603)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:639)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:643)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.parentFrame(RemoteWebDriver.java:981)
at company.selenium.Focusser.focusOnLoginFrame(Focusser.java:32)
at company.steps.LoginSteps.parametrizedLogin(LoginSteps.java:41)
at company.steps.LoginSteps.iLogInWithRoleAndBranch(LoginSteps.java:37)
at ✽.I log in with role EXPDISB and with branch 108(file:///testXX.feature:25)
Caused by: java.io.UncheckedIOException: java.net.ConnectException: Connection refused: no further information: localhost/0:0:0:0:0:0:0:1:9515
在本地运行时,我很少拥有它,但是在詹金斯上,我有50%的时间拥有它。 我实际上同时运行7个不同的套件,分为2个jenkins节点。 我运行一个独立启动的本地WebDriver,然后启动测试。
我们正在跑步
- chromiumedge 80.0.361.50和相应的驱动程序
- 硒4.0.0 alpha5
仅用于webdriver的参数是冗长的和logpath。 硒驱动程序配置如下
EdgeOptions options = new EdgeOptions(); //edgeoptions for chromiumedge browser as per official doc
options.addArguments("UseChromium","true");
options.addArguments("window-size=1000,900");
options.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR,UnexpectedAlertBehaviour.ACCEPT);
options.addArguments("--disable-site-isolation-trials");
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
options.setExperimentalOption("useAutomationExtension",false);
try {
return new RemoteWebDriver(new URL("http://localhost:9515"),options);
} catch (MalformedURLException e) {
return null;
}
我添加了一些调试代码,看来msedge驱动程序在执行过程中完全崩溃了。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。