selenium ().警示();正在引发空指针异常

3qpi33ja  于 2022-11-24  发布在  其他
关注(0)|答案(1)|浏览(132)

facing it Only with edge 106,107,108 and the latest driver. and I'm using selenium 3.4.0
NullPointerException Stack Trace: java.lang.NullPointerException at org.openqa.selenium.remote.RemoteWebDriver.getWindowHandle(RemoteWebDriver.java:554) at org.openqa.selenium.edge.EdgeDriver$$EnhancerByCGLIB$$2174fa6c.CGLIB$getWindowHandle $63() at org.openqa.selenium.edge.EdgeDriver$$EnhancerByCGLIB$$2174fa6c$$FastClassByCGLIB $$d8f722da.invoke() at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at *************************************** at org.openqa.selenium.edge.EdgeDriver$$EnhancerByCGLIB$$2174fa6c.getWindowHandle()

the same is working for all other browsers, it started with the edge 106 release, and it is coming intermittently. If required furthur info please comment.

facing it only with edge drivers 106,107,108 and the latest. and I'm using selenium 3.4.0

fykwrbwg

fykwrbwg1#

请尝试以下解决方案:

WebDriverWait wait = new WebDriverWait(driver, 20);
Alert alert = wait.until(ExpectedConditions.alertIsPresent());

然后您可以使用alert

相关问题