我正在使用 Codeception 进行验收测试。Selenium 驱动程序版本3.3.1 (selenium-server-standalone-3.3.1.jar) 以及最新版本的 firefox 52进行测试。我已经将 geckodriver 0.15 版添加到 Windows 的环境变量 Path 中。但是在运行验收测试时,我收到以下错误:
“[错误] 在 null 上调用成员函数 get()”
此外,我在 selenium 运行终端中收到以下警告:
“驱动程序可执行文件的路径必须由 webdriver.gecko.driver 系统属性设置”
以下是我的acceptance.suite.yml文件:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: 'http://www.test.com/'
browser: 'firefox'
- Asserts
- \Helper\Acceptance
要运行 selenium 驱动程序,我运行以下命令:
java -jar tests\selenium-server-standalone-3.3.1.jar
为了运行测试,我运行以下命令:
vendor\bin\codecept run tests\acceptance\TestCest.php
selenium 是否无法从 Windows 的环境变量 Path 中读取路径?
最后,我通过以下步骤使其工作:
原来我必须将geckodriver可执行文件复制到system32文件夹中才能被selenium驱动程序运行(在此之前,我将不同文件夹中的geckodriver的路径添加到Path环境变量中,但它不起作用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句