小编典典
该Selenium客户端绑定将尝试找到geckodriver从系统中可执行文件PATH。你将需要将包含可执行文件的目录添加到系统路径。
在Unix系统上,如果使用的是与bash兼容的shell,则可以执行以下操作将其附加到系统的搜索路径中:
export PATH=$PATH:/path/to/geckodriver
在Windows上,你需要更新Path系统变量以将完整目录路径添加到可执行文件。其原理与Unix相同。
使用任何编程语言绑定来启动最新的firefox的以下所有配置都适用于Selenium2显式启用Marionette。在Selenium 3.0及更高版本中,你不需要做任何事情来使用木偶,因为它是默认启用的。
要在测试中使用木偶,你将需要更新所需的功能才能使用它。
Java:
作为例外,很明显,你需要geckodriver.exe从此处下载最新版本,并geckodriver.exe使用变量将系统中存在的已下载路径设置为具有变量的系统属性,webdriver.gecko.driver然后启动木偶驱动程序并启动Firefox,如下所示:
//if you didn't update the Path system variable to add the full directory path to the executable as above mentioned then doing this directly through code
System.setProperty("webdriver.gecko.driver", "path/to/geckodriver.exe");
//Now you can Initialize marion