MRAJ Posted October 25, 2021 Posted October 25, 2021 Hello, I am using edge browser and using edge webdriver UDF to run my scripts. From few days when i run my scripts using Task scheduler, it starts but not opening the edge browser and hung in task bar. I also using updated webdriver as per edge browser. Below are the debug logs which i am getting like WinHTTP request timed out before Webdriver.... Strange is that sometimes it will load and sometimes not. I tried to set the below _wd_core but every 2 success again 2 times failure. Global $_WD_HTTPTimeOuts[4] = [0, 60000, 30000, 80000] _WD_IsLatestRelease: _WD_IsLatestRelease ==> Success _WD_Startup: OS: WIN_2012R2 WIN32_NT 9600 _WD_Startup: AutoIt: 3.3.14.5 _WD_Startup: WD.au3: 0.4.1.1 (Update available) _WD_Startup: WinHTTP: 1.6.4.2 _WD_Startup: Driver: E:\path\msedgedriver.exe _WD_Startup: Params: --verbose _WD_Startup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}} __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
Danp2 Posted October 25, 2021 Posted October 25, 2021 Are you able to reproduce the issue when running the script without using Task scheduler? What version of MSEdge? MSEdgedriver? Latest Webdriver UDF Release Webdriver Wiki FAQs
MRAJ Posted October 25, 2021 Author Posted October 25, 2021 The scripts will running fine with Task scheduler, but sometimes it will fail 10 times in a day and hunged in task bar what i have seen. The scripts were running fine from months, but i saw this strange behaviour from couple of days after whenever i changed the version of update drivers. I am using 95.0.1020.30 edge driver & edge browser 32 bit both same.
Danp2 Posted October 25, 2021 Posted October 25, 2021 Seems like an environmental issue. A couple of ways that you could solve -- - Revert to an earlier combination of Edge / Edgedriver that don't exhibit this behavior - Rewrite your script so that it launches once and remains active for an extended period of time Latest Webdriver UDF Release Webdriver Wiki FAQs
MRAJ Posted October 25, 2021 Author Posted October 25, 2021 I tried with rewrite the script, and then run, sometimes full day no issue, but next day again it will hang and in task bar i saw the script and webdriver will not be killed and stayed until manually i end the task. and the script will hung and not read the commands.
MRAJ Posted October 26, 2021 Author Posted October 26, 2021 As i am running multiple scripts one after another, is there any way to stop or kill the previous hunged script and driver, so that another script will not be impacted, becuase as same webdriver other scripts using too, so what i have seen if one scripts and webdriver hunged, another script will also get hunged and this keeps on going until manually i have to kill or stop or change the scripts to run smoothly. Shall i put the below in all the scripts so that it will kill the webdriver and scripts of previous script and then run with fresh. Local $sDesiredCapabilities, $sSession, $sElement _WD_DeleteSession($sSession) _WD_Shutdown() SetupEdge() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession,$URL)
Danp2 Posted October 26, 2021 Posted October 26, 2021 4 hours ago, MRAJ said: Shall i put the below in all the scripts so that it will kill the webdriver and scripts of previous script and then run with fresh. You shouldn't call _WD_DeleteSession here because you don't have a valid session ID at that point. But it's not a problem because _WD_Startup() will close an existing webdriver instance as long as you haven't changed the default behavior with _WD_Option('DriverClose') Latest Webdriver UDF Release Webdriver Wiki FAQs
MRAJ Posted October 26, 2021 Author Posted October 26, 2021 Currently i am using the below , do i neeed to add _WD_Option('DriverClose') under Func SetupEdge() ? Func SetupEdge() _WD_Option('Driver', 'msedgedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & StringReplace (@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"]}}}}' EndFunc
Danp2 Posted October 26, 2021 Posted October 26, 2021 No. The default action is to close an existing console and then relaunch it. To change that behavior, you would issue the following -- _WD_Option('DriverClose', False) But in your case, you want the existing instances to close, so the defaults should work for you. Latest Webdriver UDF Release Webdriver Wiki FAQs
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