0

When I print my Webdriver reference variable, I get the following value,

ChromeDriver: chrome on XP (d4631482441c5b7fd464863f70aba801)

Can someone explain in detail about what these values mean individually?

2 Answers2

0

Once the ChromeDriver successfully instantiates a Chrome Browsing Context, if you print the the instance of the WebDriver variant i.e. the ChromeDriver:

System.setProperty("webdriver.chrome.driver", "C:\\Utility\\BrowserDrivers\\chromedriver.exe");
WebDriver driver =  new ChromeDriver();
System.out.println(driver);

The console output is:

ChromeDriver: chrome on WINDOWS (34992f3b864a9063bf5fe90e4e09345e)

Explanation

The components of the output are as follows:

  • ChromeDriver: Represents the WebDriver variant.
  • WINDOWS: Represents the Platform variant.
  • 34992f3b864a9063bf5fe90e4e09345e: Represents the SessionID of the Browsing Context.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • What dies the value (34992f3b864a9063bf5fe90e4e09345e) mean? – Sanjay Nitin Feb 13 '20 at 11:19
  • @SanjayNitin Checkout the updated answer and let me know the status. – undetected Selenium Feb 13 '20 at 11:27
  • Now I understand the meaning, but I am facing a null pointer exception in the framework I am using. The first class runs fine but before the execution of the second class, it throws null pointer exception. If you have a little time can you look into this: https://stackoverflow.com/questions/60189394/issue-in-selenium-testng-page-object-model-framework – Sanjay Nitin Feb 13 '20 at 11:42
0

You see the toString() of RemoteWebDriver, which ChromeDriver inherits from. ChromeDriver doesn't override it so you see the parent implementation

@Override
public String toString() {
    return String.format("%s: %s on %s (%s)", getClass().getSimpleName(), caps.getBrowserName(), platform, getSessionId());
}

getClass().getSimpleName() = ChromeDriver

caps.getBrowserName() = Chrome

platform = Windoes XP

getSessionId() = d4631482441c5b7fd464863f70aba801

Guy
  • 46,488
  • 10
  • 44
  • 88