I want to know the following information from my current running ChromeDriver:
According to this page, It should be part of the ChromeDriver's returned capabilities:
What I tried so far:
Capabilities caps = DesiredCapabilities.chrome(); System.out.println(caps.getCapability("userDataDir")); System.out.println(caps.getCapability("chrome.chromedriverVersion"));
Both are giving me null. I do know that I'm not manually setting the ChromeOptions "--user-data-dir" but still, I know that ChromeDriver will use a certain directory by default.
Same goes with the version, It makes sense that we can retrieve the current driver's version at will right?
What am I missing here?
Thanks in advance!
UPDATE 1:
I'm calling the code above right before passing the caps
instance as a parameter to the ChromeDriver constructor.
Here's a slightly more insightful snippet:
public class Driver implements WebDriver { private WebDriver webDriver; private Capabilities caps; public Driver(){ caps = DesiredCapabilities.chrome(); caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); caps.setCapability(CapabilityType.SUPPORTS_APPLICATION_CACHE, true); caps.setCapability(CapabilityType.SUPPORTS_ALERTS, true); caps.setCapability(CapabilityType.SUPPORTS_FINDING_BY_CSS, true); //Am I not doing this correctly? System.out.println(caps.getCapability("userDataDir")); System.out.println(caps.getCapability("chrome.chromedriverVersion")); webDriver = new ChromeDriver(caps); } }
UPDATE 2: Regarding the version number, I realized that whenever I do
Capabilities caps = DesiredCapabilities.chrome();
the DesiredCapabilities class is passing a blank string as a parameter to the version number.
With that said, is there any way I can get the current chrome driver version (boxed below)? I know this information is stored somewhere but I do not know how to get it.
As for the temporary user-data folder, I still have no idea how to get it even after watching the capabilities and the webdriver object created.
Appreciate the help!