我尝试通过Ubuntu计算机上的jenkins在Firefox上使用硒运行自动测试,但无法运行它.但是,使用Eclipse可以运行相同的代码而不会失败.我正在将其作为Maven项目运行.
I tried running Automated test using selenium on firefox through jenkins on Ubuntu Machine but not able to run it. But the same code is running without failure using Eclipse. I am running it as maven project.
遇到以下错误-
"[INFO] Running TestSuite 1524549883598 geckodriver INFO geckodriver 0.20.0 1524549883615 geckodriver INFO Listening on 127.0.0.1:14395 1524549883939 mozrunner::runner INFO Running command: "/usr/lib/firefox/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.78vmBc1aqdpF" 1524549883941 geckodriver::marionette TRACE connection attempt 0/600 ExceptionHandler::GenerateDump cloned child 6290 ExceptionHandler::SendContinueSignalToChild sent continue signal to child ExceptionHandler::WaitForContinueSignal waiting for continue signal... 1524549884041 geckodriver::marionette TRACE connection attempt 1/600 1524549884141 webdriver::server DEBUG <- 500 Internal Server Error {"value":{"error":"unknown error","message":"Process unexpectedly closed with status signal","stacktrace":""}} Msg Process unexpectedly closed with status signal Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z' System info: host: 'Unknown', ip: 'Unknown', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-96-generic', java.version: '1.8.0_131' Driver info: driver.version: FirefoxDriver remote stacktrace:Firefox版本-60.0b10 硒-3.11.0 使用Gecko驱动程序"
Firefox version -60.0b10 Selenium -3.11.0 Using Gecko driver"
推荐答案此错误消息...
1524549884141 webdriver::server DEBUG <- 500 Internal Server Error {"value":{"error":"unknown error","message":"Process unexpectedly closed with status signal","stacktrace":""}}...表示牵线木偶无法启动与 WebClient 即 Firefox 浏览器的活动连接.
...implies that the marionette wasn't able to initiate an active connection with the WebClient i.e Firefox browser.
您的主要问题是所使用的二进制文件之间的版本兼容性:
Your main issue is the version compatibility between the binaries you are using as follows :
- 您的 Selenium Client 版本是 3.11.0 .
- 您的 JDK版本是 1.8.0_131 ,这很古老.
- 您的 GeckoDriver 版本是 v0.20.0 .
- 您不知道您的 Firefox 版本.
- Your Selenium Client version is 3.11.0.
- Your JDK version is 1.8.0_131 which is pretty ancient.
- Your GeckoDriver version is v0.20.0.
- Your Firefox version is unknown to us.
因此 JDK v8u131 , Selenium Client v3.11.0 和 GeckoDriver v0.20.0 之间存在明显的不匹配.
So there is a clear mismatch between the JDK v8u131 , Selenium Client v3.11.0 and GeckoDriver v0.20.0.
- 将 JDK 升级到最新级别 JDK 8u162 .
- 将 GeckoDriver 升级到 GeckoDriver v0.20.1 级.
- 确保根据您的代码块,在指定位置存在 GeckoDriver .
- 确保 GeckoDriver 对非root用户用户具有可执行权限.
- 将 Firefox 版本升级到 Firefox v59.0.2 级别. 通过 IDE
- 清理您的项目工作区和重建您的项目,并且仅具有必需的依赖项.
- 使用 CCleaner 工具清除之前和之后的所有操作系统杂项在执行 Test Suite 之后.
- 如果您的基本 Web客户端版本太旧,请通过来卸载. Revo Uninstaller 并安装最新版本的 Web客户端 GA和发行版.
- 进行系统重启.
- 以非root用户身份执行Test.
- 始终在tearDown(){}方法中调用driver.quit()以关闭&优雅地销毁 WebDriver 和 Web Client 实例.
- Upgrade JDK to recent levels JDK 8u162.
- Upgrade GeckoDriver to GeckoDriver v0.20.1 level.
- Ensure that GeckoDriver is present in the specified location as per your code block.
- Ensure that GeckoDriver is having executable permission for non-root users.
- Upgrade Firefox version to Firefox v59.0.2 levels.
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
- If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
- Take a System Reboot.
- Execute your Test as a non-root user.
- Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
更多推荐
Selenium无法从Jenkins运行Firefox浏览器
发布评论