2012-03-19 208 views
0

我目前使用seleninium-webdriver进行浏览器自动化。它默认启动firefox。我如何指定要使用的浏览器和操作系统组合。是否通过Selenium :: WebDriver :: Remote :: Capabilities类,或者我应该为每个案例使用相应的驱动程序,如Selenium :: WebDriver :: Chrome for chrome? 。使用selenium-webdriver在多个浏览器中运行测试

+0

你试过在这里搜索SO?看[这个问题](http://stackoverflow.com/questions/213430/selenium-rc-run-tests-in-multiple-browsers-automatically)。 – rdvdijk 2012-03-19 06:45:39

回答

1

你可以选择,无论是与硒:: ::的webdriver远程::能力[浏览] 或只是指定的浏览器/操作系统/版本的哈希你想:

capabilities = { 
    :browserName => "firefox", 
    :platform => "Windows" 
} 
相关问题