2012-03-19 170 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" 
} 
相關問題