Using selenium web driver to run test on multiple browsers

后端 未结 7 976
时光说笑
时光说笑 2021-02-04 19:42

I\'m trying to run a same test across multiple browsers through for loop but it always run only on Firefox.

bros = [\'FIREFOX\',\'CHROME\',\'INTERNET EXPLORER\']         


        
7条回答
  •  梦毁少年i
    2021-02-04 20:27

    As Coretek said you need multiple webdriver instances. You will need to run the selenium-server .jar file and provide each one with an argument specifying the browser you want that instance of the server to run.

    The argument for Internet Explorer is *iexplore, the argument for firefox is *firefox and the argument for chrome is *chrome. These are -forcedBrowserMode arguments. Otherwise selenium won't know what it should be running against. You may need to use *iexploreProxy for your tests, sometimes it works better than the *iexplore mode.

    Check out this link for more arguments that may be useful:

    http://seleniumforum.forumotion.net/t89-selenium-server-command-options-while-starting-server

提交回复
热议问题