Robotium和詹金斯UI测试错误 [英] Robotium and Jenkins UI testing errors

查看:280
本文介绍了Robotium和詹金斯UI测试错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想没有监视器上的MacOS迷你运行Robotium UI测试时,首先就遇到了这个问题。我说Robotium code测试的用户界面点击屏幕上的,因为我们希望将一些UI自动化添加到我们的回归测试。运行solo.clickInList(X)时,我得到了詹金斯服务器上的错误是:

  junit.framework.AssertionFailedError:AbsListView没有找到!
     [执行]在com.jayway.android.robotium.solo.Waiter.waitForAndGetView(Waiter.java:492)
     [执行]在com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:406)
     [执行]在com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:388)
     [执行]在com.jayway.android.robotium.solo.Solo.clickInList(Solo.java:1081)
     [执行]在com.cars.android.robotium.TestApplication.testSearch(TestApplication.java:29)

我发现詹金斯的Xvnc需要插件,假一界面,因此模拟器可以使用它。确保在具体的工作,勾选显示模拟器窗口。现在这样做,我目前得到这个错误。

  /应用/ RealVNC公司/ VNC \\ Server.app:$ DISPLAY_NUMBER -localhost -geometry 1280×1024 -depth 24 -securitytypes无

我现在得到这个错误在詹金斯

 启动的Xvnc
[工作区] $/应用程序/ RealVNC公司/ VNC Viewer.app:77 -localhost -geometry 1280×1024 -depth 24 -securitytypes无
FATAL:不能运行程序/应用/ RealVNC公司/ VNC Viewer.app(目录/用户/共享/詹金斯/家庭/工作/ Android的/工作区):错误= 13,权限被拒绝
java.io.IOException异常:不能运行程序/应用/ RealVNC公司/ VNC Viewer.app(目录/用户/共享/詹金斯/家庭/工作/ Android的/工作区):错误= 13,权限被拒绝


解决方案

您不说Robotium测试是否在本地计算机上工作,所以我不知道Robotium code本身是否正确。

而对于安装的Xvnc,我看到一对夫妇的可能的问题:


  1. VNC Viewer.app听起来像一个VNC的客户的,而不是X11的服务器


  2. 据我所知,你不能只是在命令行中运行/Applications/Foo.app。你通常需要运行实际的二进制;像/Applications/Foo.app/Contents/MacOS/foo。


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

解决方案

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".

这篇关于Robotium和詹金斯UI测试错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆