How to get browser name using Selenium WebDriver with Java?

前端 未结 5 925
情深已故
情深已故 2020-12-31 09:50

I have a test case and need to execute based on the browser name i.e. IE or Chrome. In this test case some part will depend on browser type.

How will I get the brows

5条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 10:21

    In Python, you may access the driver.capabilities dict like this

    driver.capabilities['browserName']
    

    https://groups.google.com/forum/#!topic/selenium-users/nbSujBSc6q8

提交回复
热议问题