Selenium 当我们尝试执行“脚本超时”时,会抛出脚本超时执行选项;JSONObject responseJSON=new AXE.Builder(驱动程序,脚本URL.analyze()&引用;

Selenium 当我们尝试执行“脚本超时”时,会抛出脚本超时执行选项;JSONObject responseJSON=new AXE.Builder(驱动程序,脚本URL.analyze()&引用;,selenium,accessibility,Selenium,Accessibility,我在selenium框架中使用了Axe core,它试图执行: [JSONObject responseJSON = new AXE.Builder(driver, scriptUrl).analyze(); 引发以下异常: 16:39:26:09-12-2019>>org.openqa.selenium.ScriptTimeoutException:脚本超时 (会话信息:chrome=78.0.3904.108) 构建信息:版本:“3.141.59”,修订版:“e82be7d358”,时间:

我在selenium框架中使用了Axe core,它试图执行:

[JSONObject responseJSON = new AXE.Builder(driver, scriptUrl).analyze();
引发以下异常:

16:39:26:09-12-2019>>org.openqa.selenium.ScriptTimeoutException:脚本超时 (会话信息:chrome=78.0.3904.108) 构建信息:版本:“3.141.59”,修订版:“e82be7d358”,时间:“2018-11-14T08:25:53” 系统信息:主机:'L3DV3N62',ip:'10.93.47.117',os.name:'Windows 10',os.arch:'amd64',os.version:'10.0',java.version:'1.8.0_144' 驱动程序信息:org.openqa.selenium.chrome.ChromeDriver 功能{AcceptSecureCerts:false,browserName:chrome,browserVersion:78.0.3904.108,chrome:{chromedriverVersion:78.0.3904.105(60e2d8774a81…,userDataDir:C:\Users\SSUPAR~1.TEM\AppDa…),goog:chromeOptions:{调试地址:本地主机:61391},javascriptEnabled:true,networkConnectionEnabled:false,pageLoadStrategy:normal,platform:XP,platformName:XP,proxy:proxy(),setWindowRect:true,StrictFileInteractibility:false,超时:{隐式:0,pageLoad:300000,脚本:30000},未经处理的PromptBehavior:Discover and notify} 会话ID:c3e0abe6c1b2ca3a34b765b70cc594df 位于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.http.w3chttprosecodec.createException(w3chttprosecodec.java:187) 在org.openqa.selenium.remote.http.w3chttrpresponsecodec.decode(w3chttrpresponsecodec.java:122) 位于org.openqa.selenium.remote.http.w3chttprosecodec.decode(w3chttprosecodec.java:49) 位于org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) 位于org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) 位于org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) 位于org.openqa.selenium.remote.RemoteWebDriver.executeAsyncScript(RemoteWebDriver.java:506) 位于com.deque.axe.axe$Builder.execute(axe.java:372) 位于com.deque.axe.axe$Builder.analyze(axe.java:335) 在Driver.Reuse.analyzeViolations处(Reuse.java:6146) 在AppLib.AnalyzeViolation.ExecuteComponent(AnalyzeViolation.java:25)中 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中 位于java.lang.reflect.Method.invoke(Method.java:498) 在AppLib.Reflection.execute(Reflection.java:26) 位于Driver.Demo1.testDemo1(Demo1.java:1130) 位于Driver.Demo1.main(Demo1.java:748)


以下超时设置适用于我:

JSONObject responseJSON=new AXE.Builder(驱动程序,脚本URL)
.options({runOnly:{type:'tag',value:['wcag2a','wcag2aa']}})
.setTimeout(60000).analyze();

您应该为您正在使用的编程语言添加一个标记。如果有与Axe相关的标记,您也应该添加该标记,以便将其发送给有帮助的正确读者。这不是答案,请对其他答案或问题本身进行评论。更新了答案