MRAJ Posted December 9, 2020 Share Posted December 9, 2020 Hello, I tried to schedule in task scheduler my webdriver UDF script using edge browser but it is not running and its failing but when i am running manually it is running fine without any issue. Please help if i am missing anywhere. Link to comment Share on other sites More sharing options...
Danp2 Posted December 9, 2020 Share Posted December 9, 2020 Post your script or a short "reproducer" script that we can run to observe the issue. Otherwise, we can only guess at what the problem might be. P.S. Have you checked the log files? If so, what did you find there? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted December 9, 2020 Author Share Posted December 9, 2020 #include "wd_core.au3" #include "wd_helper.au3" $_WD_DEBUG = $_WD_DEBUG_None ; Could also use $_WD_DEBUG_Error Local $sDesiredCapabilities, $sSession, $sElement SetupEdge() _WD_Startup() Sleep(2000) ;_WD_ConsoleVisible() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession,"$URL") Sleep(4000) _WD_DeleteSession($sSession) _WD_Shutdown() 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"], "useAutomationExtension": false}}}}' EndFunc _WD_DeleteSession($sSession) _WD_Shutdown() It is just simple script to run the URL of the website. I am not able to find any logs , in Task scheduler i am just seeing task successfully started and finished. I am trying to get logs and let you know if i can reproduce. Link to comment Share on other sites More sharing options...
MRAJ Posted December 9, 2020 Author Share Posted December 9, 2020 Have you checked the log files? If so, what did you find there? - which log files you are talking, please let me know. Link to comment Share on other sites More sharing options...
Danp2 Posted December 9, 2020 Share Posted December 9, 2020 Change this -- _WD_Option('DriverParams', '--verbose') to something like this -- _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\msedge.log"') Adjust the path as needed to work in your environment Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted December 9, 2020 Share Posted December 9, 2020 You could also do something like this if you want to capture the UDF output -- ; Comment out the following line in your script ;$_WD_DEBUG = $_WD_DEBUG_None ; Could also use $_WD_DEBUG_Error $_WD_DEBUG = $_WD_DEBUG_Info ; Gives you the greatest level of details _WD_Option('console', @ScriptDir & "\wdudf.log") This will redirect the UDF output that normally goes to the Scite output panel to a file so that you can review it following the script execution. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted December 9, 2020 Share Posted December 9, 2020 Just tested a simple Edge script and it is working fine in task scheduler. I compile it x86, and specify the location of the exe. Run 1 time in 2 minutes. Got it working.. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted December 9, 2020 Share Posted December 9, 2020 @Nine Likely the OP's issue is environmental. Could be as simple as a rights issue where the user account used to launch the task doesn't have access to the script's directory. Hard to say with the limited info provided. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted December 9, 2020 Share Posted December 9, 2020 If he can run it manually, he should have the rights to run under the same credentials with Task Scheduler, no ? I suspect it is the way it was entered in Task Scheduler, but like you said we do not have much info... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
MRAJ Posted December 10, 2020 Author Share Posted December 10, 2020 (edited) Attached are the logs. I am seeing in logs msedge is crashing due to RESPONSE InitSession ERROR unknown error: MSEdge failed to start: exited normally. (unknown error: DevToolsActivePort file doesn't exist), while running this error is not visible. Edited December 10, 2020 by MRAJ Link to comment Share on other sites More sharing options...
Nine Posted December 10, 2020 Share Posted December 10, 2020 Are you using a sandbox or something similar : Quote options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems options.addArguments("--no-sandbox"); // Bypass OS security model “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
MRAJ Posted December 10, 2020 Author Share Posted December 10, 2020 Do you mean test box. Yes it is test server but i am not able to run on my local machine and even Prod.. Link to comment Share on other sites More sharing options...
Danp2 Posted December 10, 2020 Share Posted December 10, 2020 @MRAJ This issue has been discussed in great detail on the net. Just Google on the phrase "webdriver DevToolsActivePort file doesn't exist" and you'll find lots of discussion and potential solutions. Can you tell us more about the task you created? Does the task execute under the logged in user's credentials? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted December 10, 2020 Author Share Posted December 10, 2020 Yes it is run under logged in users credentials Link to comment Share on other sites More sharing options...
MRAJ Posted December 10, 2020 Author Share Posted December 10, 2020 I am running many websites using IE same way and it is running fine. Link to comment Share on other sites More sharing options...
Danp2 Posted December 10, 2020 Share Posted December 10, 2020 @MRAJ You continue to provide only minimal details in your responses. You can't expect us to work harder than you to try to solve your problem. Therefore, I am unwilling to help you further until you can show that you've researched the issue and tried some of the recommended solutions. TheXman 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted December 10, 2020 Author Share Posted December 10, 2020 Hello Dan, I tried solution like giving admin privilege to my scripts, path, even i changed the msedge to script directory, and schedule in task schedule like account to run which i logged in and script path to run. I search in net but not getting proper answer what i am doing through scheduling the script. upgrading and downloading the newer version of browser and webdriver. Still i am researching on this. As it is running manually without any issue but if i schedule it is giving me issue. Link to comment Share on other sites More sharing options...
MRAJ Posted December 11, 2020 Author Share Posted December 11, 2020 I just created a task like use the account which i logged in, Run only when user is logged in, Run with highest privileges, configure for OS, run every 5 mins, Actions: path of the exe file. and below is the page it will load and it will not go further, i tried to run using batch script and gave the path of the script and browser if may be exe file it is not accepting. I am not sure may be some compatible issue with Task scheduler or is there any bug with edge browser. Still i am trying best but not success still. and in net i found the below but not sure where to add. I tried to run using user account not admin but still same issue. options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems options.addArguments("--no-sandbox"); // Bypass OS security model Link to comment Share on other sites More sharing options...
Danp2 Posted December 11, 2020 Share Posted December 11, 2020 These would become part of your DesiredCapabilities string. Previous example posted here. Does the behavior change if you don't check the "Run with highest privileges" box? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted December 11, 2020 Author Share Posted December 11, 2020 Hello Dan, Yes its working after changing unchecking the "Run with highest privileges" box. Cool Dan. You are best. 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