这是我实例化 Web 驱动程序的代码:
System.setProperty("webdriver.edge.driver", driverFilePath);
webDriver = new EdgeDriver();
它按预期工作,直到我尝试在执行期间使用以下代码刷新 UI:
webDriver.navigate().refresh();
执行此代码后,我将低于堆栈跟踪:
Timeout (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'ZQA-262', ip: '10.139.245.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_141' Driver info: org.openqa.selenium.edge.EdgeDriver Capabilities {acceptSslCerts: true, applicationCacheEnabled: true, browserName: MicrosoftEdge, browserVersion: 40.15063.674.0, javascriptEnabled: true, locationContextEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10, takesElementScreenshot: true, takesScreenshot: true, webStorageEnabled: true} Session ID: 4ADB7CA0-3C4B-46EB-89C6-BA6F494FA9E0
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:657)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.refresh(RemoteWebDriver.java:919)
at com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject.zRefreshMainUI(AbsSeleniumObject.java:828)
此后的所有 testng 测试都被跳过。请让我知道是否有任何解决方案/解决方法。提前致谢!