2012-09-26 56 views
3

我有测试过的web应用程序。我需要使用Firefox 5从Lunix和Windows进行测试。那么,我怎样才能在Firefox 5的新FirefoxDriver()中设置特定的Firefox版本,而不是Firefox 6或9? 我不想设置路径到Firefox,因为它不是有用的方法,当我们有几个操作系统。如何在Selenium Webdriver中设置特定的Firefox版本?

回答

2

创建一个firefox 5配置文件,并在下面给出该配置文件的名称。它将启动给定的配置文件浏览器。

FirefoxProfile profile = new ProfilesIni().getProfile(profileName); 
DesiredCapabilities dc = DesiredCapabilities.firefox(); 
dc.setCapability(FirefoxDriver.PROFILE, profile); 
driver = new FirefoxDriver(dc); 

请参阅本link知道如何创建Firefox配置文件。

相关问题