如何在 headless 浏览器中运行使用 Selenium IDE(Firefox 插件)制作的测试用例?
当我使用 firefox 插件创建测试用例时,它将它们保存为 .html 文件。
我正在尝试设置一种在 headless 浏览器中运行它们的方法(使用 phantomJS 或其他工具/库)。我看到很多人提到在隐藏框架中运行 firefox,但这与 headless(即 PhantomJS)不同
我已经弄清楚如何从命令行运行selenium测试用例,但仅限于firefox或ie,我无法让它在phantomjs上运行.html测试用例:
java -jar selenium-server-standalone-2.39.0.jar -htmlSuite "*firefox" "http://127.0.0.1" "ts-ProjectList/TestSuite.html" "ProjectList-results.html"
我知道 IDE 可以导出不同语言的测试用例,但我希望非技术团队成员能够使用 firefox 插件创建测试。
最佳答案
将“*firefox”更改为 phantomjs 应该可以帮助您入门。
您需要 phantomJS 驱动程序: http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver_phantomjs/selenium.webdriver.phantomjs.webdriver.html
关于Selenium IDE 和 headless 浏览器测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24636413/