SEKOMD Posted June 18, 2024 Posted June 18, 2024 Could you please advise on how to launch the Edge window in a way that allows for later attachment? I've figured out how to do it in Chrome already, but the same approach doesn't seem to work in Edge. #include "wd_core.au3" #include "wd_capabilities.au3" #include "wd_helper.au3" $bTryAttach = False ;port - 9223 _WD_Option('Driver', 'msedgedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'msedge') _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') ;_WD_CapabilitiesAdd('firstMatch', 'chrome') If $bTryAttach Then _WD_CapabilitiesAdd('debuggerAddress', '127.0.0.1:9223') Else _WD_CapabilitiesAdd('args', '--remote-debugging-port=9223') EndIf _WD_CapabilitiesDump(@ScriptLineNumber) ;dump current Capabilities setting to console - only for testing in this demo _WD_Startup() $sSession = _WD_CreateSession(_WD_CapabilitiesGet()) ;_WD_Navigate($sSession, 'https://myip.com') _WD_Navigate($sSession, 'https://google.com') MsgBox(64, '', 'Attach test') ;_WD_DeleteSession($sSession) _WD_Shutdown() Exit Does anyone know a way to do this? My apologies in advance for my English
SEKOMD Posted June 18, 2024 Author Posted June 18, 2024 _WD_CapabilitiesAdd('detach', False) It seems this line solves my issue. I swear it's not intentional. It's not uncommon that after I lose hope and turn to a forum, a solution comes out of nowhere. I'm not entirely sure yet, but it seems like that's what happened in this case too. To be more precise, I found this parameter here.
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