MRAJ Posted September 3, 2020 Author Share Posted September 3, 2020 its running but behind the browser one script is running in command prompt which is keep on running with destroying results, not sure what it is. Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2020 Share Posted September 3, 2020 That would be the webdriver console. You can hide it with _WD_ConsoleVisible() if you desire Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2020 Share Posted September 3, 2020 Just noticed that you are calling _WD_CreateSession($sDesiredCapabilities) twice in your script. Remove the 2nd one. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted September 3, 2020 Author Share Posted September 3, 2020 i removed the 2nd one, but when i am running the script , background in Command shell so many scripts are running until i am not manually closing the Command shell..not sure why it is running behind the browser..any idea. Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2020 Share Posted September 3, 2020 Didn't I already answer that question above? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted September 3, 2020 Author Share Posted September 3, 2020 This is my script now, any changes in order or anything need to add. #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sElement SetupEdge() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.google.com") 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 Link to comment Share on other sites More sharing options...
MRAJ Posted September 3, 2020 Author Share Posted September 3, 2020 There are so many data running behind in command shell GUI while running the script. Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2020 Share Posted September 3, 2020 @MRAJ I'm not sure that I understand your concern. Does the script run successfully for you? Why are you so focused on the webdriver console? I explained above how you can hide it if it bothers you so much. When exiting your script, you should be cleaning up with something like this -- _WD_DeleteSession($sSession) _WD_Shutdown() That will close the browser session and remove the webdriver console. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted September 3, 2020 Author Share Posted September 3, 2020 Thanks script is running and opening the browser Sorry i didnt see your old post.. now i configured the script as below to hide the Webdriver console using _WD_ConsoleVisible(), but still console is running behind and closing after the browser shut down. Is there any way to hide the console. #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sElement _WD_ConsoleVisible() SetupEdge() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.google.com") 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() Link to comment Share on other sites More sharing options...
Nine Posted September 3, 2020 Share Posted September 3, 2020 You need to put _WD_ConsoleVisible() after _WD_Startup() On the side note, please use this tool, when you post code. Do not mix func code with main code, put all you main code BEFORE the functions. “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...
Nine Posted September 3, 2020 Share Posted September 3, 2020 Forgot to tell you, put some sleep (2000) between to give time to the driver to load. Like this : SetupEdge() _WD_Startup() Sleep(2000) _WD_ConsoleVisible() “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 September 3, 2020 Author Share Posted September 3, 2020 #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sElement SetupEdge() _WD_Startup() Sleep(2000) _WD_ConsoleVisible() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.google.com") 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() I tried the above script and changed Sleep(2000), still first Console is opening and wait for 2 seconds then browser is opening. Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2020 Share Posted September 3, 2020 You could also set the following at the beginning of your script -- $_WD_DEBUG = $_WD_DEBUG_None ; Could also use $_WD_DEBUG_Error This will cause the console window to be hidden by default, but it will reduce the amount of information written to the Scite console for debugging purposes. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted September 3, 2020 Author Share Posted September 3, 2020 Awesome Dan..Thanks console is not visible now. Thanks Nine:) Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2020 Share Posted September 3, 2020 (edited) Anyone figure out how to prevent MSEdge from pinning a shortcut to the taskbar every time it gets launched via msedgedriver? Edit: I solved it by creating a master_preferences file. More details found here. Edited September 3, 2020 by Danp2 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