Hermes Posted June 9, 2021 Share Posted June 9, 2021 Hi, sometimes when I run my script in GUI (SciTe Editor) or as an executable file, the chrome driver launches but the chrome browser does not but when I re-run the script again - chrome driver launches and so does the browser. Here is the error that I'm getting: __WD_Post: StatusCode=0; ResponseText=WinHTTP request timed out before Webdriver... __WD_Post ==> Send / Recv error: WinHTTP request timed out before Webdriver _WD_CreateSession: WinHTTP request timed out before Webdriver _WD_CreateSession ==> Webdriver Exception: HTTP status = 0 Just wondering if there's a way to re-launch both the driver and browser without having to rerun the script/executable. Link to comment Share on other sites More sharing options...
Luke94 Posted June 9, 2021 Share Posted June 9, 2021 What capabilities are you using? Link to comment Share on other sites More sharing options...
Hermes Posted June 9, 2021 Author Share Posted June 9, 2021 (edited) Thanks for responding, here's the function i have for capabilities: Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}' EndFunc ;==>SetupChrome It's not a capabilities issue, it launches sometimes and other times it doesn't launch at all. @Danp2 Hi, is this some kind of a glitch in Auto It v 3.3.14.5, and SciTe Editor (32-bit Version 4.2.0)? Or is there a way to solve it? Edited June 9, 2021 by Hermes Link to comment Share on other sites More sharing options...
Luke94 Posted June 9, 2021 Share Posted June 9, 2021 From a quick read (so I might be wrong), @Danp2 mentions here to try: Update to the latest WinHTTP here Change the default WinHTTP Timeouts Set the following in your capabilities and use _WD_LoadWait "pageLoadStrategy":"none" If I remember rightly, I had the same problem and set the timeouts in the capabilities which fixed the issue. "timeouts": {"implicit": 0, "pageLoad": 60000, "script": 30000} Try: Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"], "timeouts": {"implicit": 0, "pageLoad": 60000, "script": 30000}}}}}' EndFunc ;==>SetupChrome I wasn't able to test the above code. Link to comment Share on other sites More sharing options...
Danp2 Posted June 9, 2021 Share Posted June 9, 2021 @HermesIf might help if you showed the complete Scite output when Chrome fails to launch. Have you checked Chrome.log for any meaningful details on why it failed to launch the browser? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now