0 votes
1 view
in DevOps and Agile by (19.8k points)

How would I get the browser version being used?

>>> from selenium import webdriver

>>> driver = webdriver.Firefox()

>>> print version <-- how to do this?

    Firefox 12.0

1 Answer

0 votes
by (63.4k points)

The capabilities property is a dictionary containing information about the browser, so if you are using Chrome then this should work:

print driver.capabilities['version']

And if you are using Firefox, the following should work:

driver.capabilities['browserVersion']

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium training

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...