[英]How to run Selenium server (RC) via Jenkins on a virtual machine?
I'm trying to automate tests using Jenkins.我正在尝试使用 Jenkins 自动化测试。 The principle of operation is as follows: There is a main machine (ubuntu 22) on which tests (pyTest) are stored and virtual machines (Ubuntu 18 and 20) are created, and jenkins is connected to the main machine.操作原理如下:有一台主机(ubuntu 22),上面存储测试(pyTest)并创建虚拟机(Ubuntu 18和20),jenkins连接到主机。
The problem is the following, I am trying to run Selenium Server from Jenkins on a virtual machine by running the command:问题如下,我试图通过运行命令在虚拟机上从 Jenkins 运行 Selenium 服务器:
sh '''ssh user@ip java -jar ~/selenium_driver/selenium-server-4.3.0.jar standalone -p 1234 > logs.log 2>&1'''
Although I got rid of the data output to the console, but the step in jenkins still "freezes" waiting for the command to complete and does not proceed to the next step.虽然我把数据 output 去掉到控制台,但是 jenkins 中的步骤仍然“冻结”等待命令完成,并没有进行下一步。
How can this problem be solved?如何解决这个问题? To perform the next step, after executing the selenium server startup command.执行下一步,执行selenium服务器启动命令后。 Maybe you can move on to the next step without waiting for the previous one to be completed.也许您可以继续下一步,而无需等待上一步完成。 I use PipeLine我使用管道
Decided so:如此决定:
stage('NameStage') {
timeout(time: 20, unit: 'SECONDS') {
sh """
ssh user@ip 'java -jar ~/selenium_driver/selenium-server-4.3.0.jar standalone -p 1234 > ~/logs.log 2>&1'
"""
}
}
After 20 seconds, the step is completed, while selenium remains working in the background 20 秒后,步骤完成,而 selenium 仍在后台工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.