MRAJ Posted July 6, 2023 Posted July 6, 2023 Hello i am running the below code in my server using task scheduler at certain intervals like every 10 mins and its running fine when its in logged in but when i close the server(not signed out, i just lock) , its stops running, not sure why it is only happening when i using the IEDriverserver.exe to run edge in IE mode. I am asking because i am running many scripts using msedgedriver webdriver UDF and IE and its running fine even i close the server. Please suggest. expandcollapse popup#include "wd_core.au3" #include "wd_helper.au3" #include "wd_capabilities.au3" Local $sSession, $sElement,$sCapabilities Local $sCapabilities = SetupEdgeIEMode() _WD_Startup() $sSession = _WD_CreateSession($sCapabilities) _WD_Navigate($sSession, "URL") _WD_Window($sSession,"maximize") _WD_LoadWait($sSession) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='unamebean']") _WD_SetElementValue($sSession,$sElement,"username") Sleep(2000) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='pwdbean']") _WD_SetElementValue($sSession,$sElement,"password") Sleep(2000) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@id='SubmitButton']") _WD_ElementAction($sSession,$sElement,'click') _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupEdgeIEMode() ; this is for MS Edge IE Mode Local $sTimeStamp = @YEAR & '-' & @MON & '-' & @MDAY & '_' & @HOUR & @MIN & @SEC _WD_Option('Driver', 'IEDriverServer.exe') ; ;_WD_Option('Port', _WD_GetFreePort(5555, 5600)) Local $iPort = _WD_GetFreePort(5555, 5600) If @error Then Return SetError(@error, @extended, 0) _WD_Option('Port', $iPort) _WD_Option('DriverParams', '-log-file="' & @ScriptDir & '\log\' & $sTimeStamp & '_WebDriver_EdgeIEMode.log" -log-level=INFO' & " -port=" & $_WD_PORT & " -host=127.0.0.1") _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'msedgeie') _WD_CapabilitiesAdd('w3c', True) Local $sPath = _WD_GetBrowserPath("msedge.exe") If $sPath Then _WD_CapabilitiesAdd("ie.edgepath", $sPath) _WD_CapabilitiesAdd("ie.edgechromium", True) _WD_CapabilitiesAdd("ignoreProtectedModeSettings", True) _WD_CapabilitiesAdd("initialBrowserUrl", "URL") _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesDump(@ScriptLineNumber) Local $sCapabilities = _WD_CapabilitiesGet() Return $sCapabilities EndFunc ;==>SetupEdgeIEMode
Danp2 Posted July 6, 2023 Posted July 6, 2023 Unsure if you can use headless mode with this configuration, but you may want to try that. P.S. Seems like a duplicate of your prior thread. Latest Webdriver UDF Release Webdriver Wiki FAQs
MRAJ Posted July 6, 2023 Author Posted July 6, 2023 can you let me know the script for headless mode and where to use it.
Danp2 Posted July 6, 2023 Posted July 6, 2023 This information can readily be found on this forum if you try to locate it. Hint: check your prior thread. There's also a FAQ in the wiki that discusses this topic. 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