2016-08-04 87 views
2

我遇到了一个关于硒3自动ui测试的大问题。首先,我阐明我是如何运行的Firefox 46硒测试与硒2.X:Selenium 3 - 木偶 - 自定义Firefox配置文件

- Start selenium server on console: java -jar selenium.jar -firefoxProfileTemplate c:\selenium\firefox_profile 
- Run (behat) tests from another console 

现在,我读过,火狐48不支持webdriver的了,搬到了木偶的webdriver 。好的,所以我下载了Selenium 3 beta和相应的geckodriver,并再次启动上述worflow - 它的工作BUT:

我的网站使用自签名SSL证书。好吧,这是没有问题的以前硒版本的webdriver,我可以创建一个自定义的Firefox配置文件,并通过追加firefoxProfileTemplate标志来使用它。 Seionium 3与Marionette驱动程序有关的问题是,该标志不再存在。

那么如何从命令行指定firefox配置文件,在打开Firefox时使用selenium/Marionette?有没有新的选择?或者也许是一个全球性的配置文件?

关于下述

回答

0

不知道你使用的语言,但对于Java端,你可以使用旧FirefoxProfile设置Firefox的驱动程序支持SSL。看下面的代码:

DesiredCapabilities capabilities = DesiredCapabilities.firefox(); 
    FirefoxProfile fp = new FirefoxProfile(); 
    // fp.addExtension(extensionToInstall); 
    // http://stackoverflow.com/questions/15292972/auto-download-pdf-files-in-firefox 
    // http://www.webmaster-toolkit.com/mime-types.shtml 
    // for config list see this : 
    // http://kb.mozillazine.org/About:config_entries#Profile. 
    fp.setAcceptUntrustedCertificates(true); 
    fp.setAssumeUntrustedCertificateIssuer(true); 
    fp.setEnableNativeEvents(false); 
    capabilities.setCapability(FirefoxDriver.PROFILE, fp); 

这是一个有点硬,当硒切换所有的老司机W3C webdriver的,没有太多的文档这里的用户,希望这可以帮助你。