hsac-fitnesse-fixtures
hsac-fitnesse-fixtures copied to clipboard
How can I increase javascript script timeout ?
How can I specify a high script timeout , so that I can step through the javascript without getting
org.openqa.selenium.ScriptTimeoutException: script timeout (Session info: MicrosoftEdge=124.0.2478.97) Build info: version: '4.20.0', revision: '866c76ca80' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.17' Driver info: org.openqa.selenium.edge.EdgeDriver Command: [6b4a22d9865a9bb4b51fe638249c4d62, executeScript {script=verantwoordelijkheden(), args=[]}] Capabilities {acceptInsecureCerts: false, browserName: MicrosoftEdge, browserVersion: 124.0.2478.97, fedcm:accounts: true, ms:edgeOptions: {debuggerAddress: localhost:54323}, msedge: {msedgedriverVersion: 124.0.2478.97 (cfa68c26d43d..., userDataDir: C:\Users\PBEMMELE\AppData\L...}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: windows, proxy: Proxy(), se:cdp: ws://localhost:54323/devtoo..., se:cdpVersion: 124.0.2478.97, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: ignore, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true} Session ID: 6b4a22d9865a9bb4b51fe638249c4d62 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167) : etc.
I can't figure out how to do that using $localconfig in
|start managed driver for|edge|with profile|$localconfig|
Explanation:
I have a Fitnesse script that executes javascript routine verantwoordelijkheden()
that I wrote.
I find that I can use the javascript debugger from DevTools to step through that code,
provided that that javascript code is loaded from a separate file,
so that that file can be inspected from DevTools > Sources.
So the JSCODE imports that file:
!define JSCODE { {{{ var script = document.createElement('script'); script.src = "http://localhost:9090/files/verantwoordelijkheden.js"; document.head.appendChild(script); }}} } ^|script | |show|execute script|${JSCODE}|
And after it is loaded, I have the Fitnesse script execute a pause statement, allowing me to open file verantwoordelijkheden.js from DevTools, and setting a breakpoint. Then I continue from the pause statement, and have a command
|show|execute script|verantwoordelijkheden()|
that then hits the breakpoint.
This works very nice, except that I get the ScriptTimeoutException after 30 seconds, or sometimes somewhat longer.