java - Jenkins job freezes on executing jar web application - Stack Overflow

I try to execute jar web-application in Jenkins job and start Selenoid testsIf i execute command "

I try to execute jar web-application in Jenkins job and start Selenoid tests If i execute command "java -jar app.jar" in pipeline Jenkins - i get exception

2024-11-18 13:54:16,203 [main] [INFO] () [r.s.c.w.a.RemoteApplication]: Started RemoteApplication in 4.282 seconds (JVM running for 4.498) 2024-11-18 13:54:16,248 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: Please open the following address in your browser: 2024-11-18 13:54:16,249 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: http://localhost:20080 java.lang.Exception: No web browser found

and Jenkins job freezes endlessly, until I manually abort the build.

This is how I see the solution:

  1. curl jar from remote server
  2. execute jar by "java -jar app.jar"
  3. start Selenoid UI tests.
  4. stop the job

Is there any way to run jar bypassing this exception?

I try to execute jar web-application in Jenkins job and start Selenoid tests If i execute command "java -jar app.jar" in pipeline Jenkins - i get exception

2024-11-18 13:54:16,203 [main] [INFO] () [r.s.c.w.a.RemoteApplication]: Started RemoteApplication in 4.282 seconds (JVM running for 4.498) 2024-11-18 13:54:16,248 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: Please open the following address in your browser: 2024-11-18 13:54:16,249 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: http://localhost:20080 java.lang.Exception: No web browser found

and Jenkins job freezes endlessly, until I manually abort the build.

This is how I see the solution:

  1. curl jar from remote server
  2. execute jar by "java -jar app.jar"
  3. start Selenoid UI tests.
  4. stop the job

Is there any way to run jar bypassing this exception?

Share Improve this question asked Nov 18, 2024 at 12:50 rustCohlerustCohle 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

The Jenkins node where the job is running has no browsers installed, or if it does then Selenoid cannot find any.

Here's something we've done to run Selenide tests on Jenkins:

docker.image('selenium/standalone-chrome').withRun('-v /dev/shm:/dev/shm -p 4444:4444') { c ->
    def selenideRemote = "http://0.0.0.0:4444/wd/hub"
    sh "mvn test -Dselenide.headless=true -Dselenide.remote=${selenideRemote} -DscreenshotsEnabled=true"
}

The combination of the Docker image, which has the proper browser etc. installed, and the headless option should make it work.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745616877a4636287.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信