Robotium and Jenkins UI testing errors

一个人想着一个人 提交于 2019-12-13 21:07:00

问题


I first ran into this problem when trying to run Robotium UI tests on a MacOS Mini with no monitor. I added Robotium code to test UI clicks on screen, since we want to add some UI automation to our regression testing. The error I get on the Jenkins server is when solo.clickInList(X) is run:

junit.framework.AssertionFailedError: AbsListView is not found!
     [exec]     at com.jayway.android.robotium.solo.Waiter.waitForAndGetView(Waiter.java:492)
     [exec]     at com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:406)
     [exec]     at com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:388)
     [exec]     at com.jayway.android.robotium.solo.Solo.clickInList(Solo.java:1081)
     [exec]     at com.cars.android.robotium.TestApplication.testSearch(TestApplication.java:29)

I found out that Jenkins needs Xvnc plugin to fake a UI so that the emulator can use it. Make sure to check "Show emulator window" in the specific job. Now doing that I currently get this error.

/Applications/RealVNC/VNC\ Server.app :$DISPLAY_NUMBER -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None

I now get this error in Jenkins

Starting xvnc
[workspace] $ "/Applications/RealVNC/VNC Viewer.app" :77 -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None
FATAL: Cannot run program "/Applications/RealVNC/VNC Viewer.app" (in directory "/Users/Shared/Jenkins/Home/jobs/Android/workspace"): error=13, Permission denied
java.io.IOException: Cannot run program "/Applications/RealVNC/VNC Viewer.app" (in directory "/Users/Shared/Jenkins/Home/jobs/Android/workspace"): error=13, Permission denied

回答1:


You don't say whether the Robotium tests work on your local machine, so I don't know whether the Robotium code itself is correct.

But regarding the Xvnc setup, I see a couple of probable issues:

  1. "VNC Viewer.app" sounds like a VNC client, rather than an X11 server.

  2. As far as I know, you can't just run "/Applications/Foo.app" on the command line. You usually need to run the actual binary; something like "/Applications/Foo.app/Contents/MacOS/foo".



来源:https://stackoverflow.com/questions/16573637/robotium-and-jenkins-ui-testing-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!