You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to open two tabs in Chrome, switch between them, and execute some JavaScript code. The problem is that I can only execute JavaScript for the main session. The other session gives me an error.
Dim browser As AutomateBrowser
Dim cdpT As cdpTarget
Set browser = new_automateBrowser
browser.launch whichBrowser:=Chromium
Set cdpT = New_cdpTarget(browser.cdp)
firstURLTargetID = cdpT.createTarget(firstURL)
SecondURLTargetID = cdpT.createTarget(SecondURL)
jsCode = "console.log('hi')"
browser.jsEval (jsCode) 'This will log "hi" in chrome console (as we don't use launch, the main tab is empty)
firstURLSessionID = cdpT.attachToTarget(firstURLTargetID)
browser.switchTo firstURLSessionID
'So far everything is working normal, I can see curSession in browser object changed to firstURLSessionID
browser.jsEval (jsCode) 'This will return Error: [-32001] Session with given id not found.
The text was updated successfully, but these errors were encountered:
I want to open two tabs in Chrome, switch between them, and execute some JavaScript code. The problem is that I can only execute JavaScript for the main session. The other session gives me an error.
The text was updated successfully, but these errors were encountered: