While automating I open several browsers, say Firefox, with
driver1 = webdriver.Firefox()
driver2 = webdriver.Firefox()
driver3 = webdriver.Firefox()
.....
Is there a way to get the session_id
and webdriver itself of the active Browser?
The same question for Appium. Is it possible to get session_id
and driver itself of the active device (virtual or real)?
There is a workaround for the problem. You could create a Session. This gives you the Webdriver Instance, but also the sessionID.
Use DataFactory. The following snippet (written in Katalon Studio, but using selenium, so I guess it would be similar or same in other tools)
will print out to console:
with session ID in brackets.
To get the driver session id with Selenium / Java:
To get the remote driver session id with Selenium / Java: