Jump to content

Chrome browser fails to launch


Recommended Posts

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

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 by Hermes
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...