Is there currently any way to get the SessionID of a Webdriver endpoint that is currently running a test? I would like to capture this so that I can pass it along on a "curl" request to get some metadata from the hosted Selenium grid service that we use.
Any ideas?
Thanks in advance.
Selenium SessionID
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Selenium SessionID
Hey,
I came up with the following code:
Cheers,
Robin
I came up with the following code:
var webdriver = Host.Current.TryGetAsWebDriverEndpoint(); var drivers = webdriver.WebDrivers; foreach (var tmp in drivers) { var driver = tmp as OpenQA.Selenium.Remote.RemoteWebDriver; var id = driver.SessionId; Console.WriteLine("SessionID " + id); }Hope this helps
Cheers,
Robin
Re: Selenium SessionID
Awesome.
Thank you!!!
Thank you!!!