power_settings_new

how to get browser name from webdriver instance?

by
asked
0 like 0 dislike
963 views
0 1
How to get browser name from webdriver instance?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

answered by
0 like 0 dislike
 
Best answer
0

You can try below code:

 

Capabilities cap = ((RemoteWebDriver) driver).getCapabilities();
String browserName = cap.getBrowserName().toLowerCase();
System.out.println(browserName);
String os = cap.getPlatform().toString();
System.out.println(os);
String v = cap.getVersion().toString();
System.out.println(v);

Related questions

add
...