简体   繁体   English

如何在虚拟机上通过 Jenkins 运行 Selenium 服务器(RC)?

[英]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.

相关问题 Selenium RC,如何在远程计算机中运行Selenium RC脚本 - Selenium RC, How to run selenium RC Scripts in remote Machine 如何在jenkins slave机器上运行selenium脚本,但脚本在Master机器中 - How to run selenium scripts in jenkins slave machine but the scripts are in Master machine 如何在不使用 Selenium 网格的情况下在虚拟机中运行 selenium 脚本? - How to run selenium scripts in virtual machine without using Selenium Grid? Selenium RC为什么看不到虚拟机上的站点 - Why can't Selenium RC see a site on virtual machine 如何使用Selenium Server在Jenkins上运行作业 - How to Run job on Jenkins with Selenium Server 如何使用Jenkins在远程机器上运行selenium脚本 - How to run selenium script on remote machine using Jenkins Jenkins 设置运行 selenium ide 脚本使用 selenium - Jenkins setup to run selenium ide script using selenium rc 硒测试在本地计算机上运行,​​但不通过詹金斯运行 - Selenium tests run on local machine but not through jenkins Selenium-dot-net-2.0rc3与Firefox 5-如何以管理员身份运行selenium服务器? - Selenium-dot-net-2.0rc3 with Firefox 5 - How do I run selenium server as admin? 将虚拟机上的Selenium测试的显示分辨率设置为Jenkins Slave - Setting display resolution for Selenium tests on virtual machine as Jenkins Slave
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM