Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否有任何方法可以指出Selenium服务器要使用哪种FF?_Selenium - Fatal编程技术网

是否有任何方法可以指出Selenium服务器要使用哪种FF?

是否有任何方法可以指出Selenium服务器要使用哪种FF?,selenium,Selenium,我的电脑上有非常旧的FF版本,但我无法更新它以在我的电脑上运行selenium测试。同时,我需要更现代的FF版本来运行selenium独立服务器 是否可以指出FF目录的哪个FF路径应该使用selenium server?使用您要使用的firefox文件夹的位置更新path变量。您可以使用firefox配置文件定义浏览器版本 FirefoxProfile fp = new FirefoxProfile(); fp.setPreference("webdriver.firefox.bin", "

我的电脑上有非常旧的FF版本,但我无法更新它以在我的电脑上运行selenium测试。同时,我需要更现代的FF版本来运行selenium独立服务器


是否可以指出FF目录的哪个FF路径应该使用selenium server?

使用您要使用的firefox文件夹的位置更新path变量。

您可以使用firefox配置文件定义浏览器版本

 FirefoxProfile fp = new FirefoxProfile();
 fp.setPreference("webdriver.firefox.bin", "Binary path of Firefox"); 
 WebDriver driver = new FirefoxDriver(fp);


Firefox二进制允许您在最喜爱的Firefox版本上运行测试

按照以下步骤操作:

在电脑中安装多个版本的Firefox。 确保使用自定义安装将已安装的Firefox版本安装在不同的路径位置 JAVA 导入java.io.File;导入org.openqa.selenium.firefox.FirefoxBinary; 导入org.openqa.selenium.firefox.FirefoxDriver; 导入org.openqa.selenium.firefox.FirefoxProfile

私有网络驱动程序

FirefoxBinary=new FirefoxBinarynew FileC://Program Files//Mozilla Firefox26//firefox.exe; FirefoxProfile profile=新的FirefoxProfile; 驱动程序=新的FirefoxDriverbinary,配置文件

python 从selenium.webdriver.firefox.firefox\u二进制文件导入FirefoxBinary

driver=webdriver.Firefoxfirefox\u binary=FirefoxBinaryC://Program Files//Mozilla Firefox26//firefox.exe

 FirefoxBinary fb = new FirefoxBinary("Binary path of Firefox");
 FirefoxProfile fp = new FirefoxProfile();
 //Using fp you can set your own profile if want
 WebDriver driver = new FirefoxDriver(fb, fp);