1.selenium2.53.0与可以支持Firefox46 Firefox43,只测试了相对叫新的版本。Firefox47会报链接错误的问题。
示例:
System.setProperty("webdriver.firefox.bin","xxx/xxx/firefox.exe");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
Webdriver driver = new FirefoxDriver(capabilities);
//WebDriver driver = new RemoteWebDriver(capabilities);
2.selenium2.41与Firefox26(绿色版)
示例:
System.setProperty("webdriver.firefox.bin","xxx/xxx/firefox.exe");
Webdriver driver = new FirefoxDriver();
3.selenium2.41与chrome(36)
示例:
//chromedriver.exe与chrome.exe在同一个文件夹,同一层
System.setProperty("webdriver.chrome.driver","xxx/Chrome/chromedriver.exe");
ChromeOptions option = new ChromeOptions();
option.addArguments("--ignore-certificate-errors");
option.addArguments("-test-type");
Webdriver driver= new ChromeDriver(option);
本文由Jessie原创或编辑,互联分享,尊重版权,转载请以链接形式标明本文地址