I'm coding in VBA. Is there a way to refer to an existing, open Chrome window using Selenium ChromeDriver?
Every time I open a new Chrome window, using Set x as New Selenium.ChromeDriver
then navigate using x.Get URL
, but this always opens up a new window.
Is there a way to refer to a Chrome window which is already open, and use that window in my code? I'm looking for something similar to:
Set Shell = New Shell32.Shell
For Each IE In Shell.Windows
If InStr(1, IE.LocationURL, strSearchURL) <> 0 Then Set IEFound = IE 'Heureka!
Next IE
UPDATE:
Someone linked this question with another one. The linked question is not the same -- not even close. It asks for some way of restarting the session without closing and reopening the browser, in order to gain performance. My problem is the opposite: how to attach an open instance of Chrome (the same, not restarted) to a new Driver object, in another procedure.
In the second answer, someone give a hint which might work, using webdriver.session_id
. unhappily, ChromeDriver for VBA doesn't have this attribute.
According to this (https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/18), it's not feasible. Snif.