Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

0
how to get browser name from webdriver instance?

Solved 1 Answers 769 Views Selenium
0 1
How to get browser name from webdriver instance?

1 Answer

0
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);
answered by

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.
...