robotium

How to check from Robotium that my png is present on the screen?

社会主义新天地 提交于 2019-12-14 02:34:35
问题 I create an additional method: public boolean exampleEdTxt1(){ try{ solo.getCurrentActivity().getResources().getDrawable(R.drawable.action_drw); return true; } catch(AssertionError e){ return false; } } But, when test is runing, code assertTrue(exampleEdTxt1()); always returns success and code assertFalse(exampleEdTxt1()); always returns fail. How to check from Robotium that my png is present on the screen? 回答1: try using .isShown() solo.getCurrentActivity().getResources().getDrawable(R

Robotium BDD with Cucumber

孤人 提交于 2019-12-14 02:32:23
问题 I want to know if you guys know how to make BDD tests with Robotium. As I research Robotium works with a different Virtual Machine (Dalvik) so I cannot run as Junit Test (Only with Android Junit Test). So I found a possible solution to run Robotium with Junit with RoboRemote https://github.com/groupon/robo-remote. But when i tried to integrate with cucumber the tests became unstable. So you guys know some way to make BDD tests using Robotium? 回答1: I have successfully integrated Robotium using

Can I run Robotium tests automatically in parallel on multiple emulators?

a 夏天 提交于 2019-12-14 01:57:17
问题 Other than splitting up my Robotium tests into multiple projects and/or suites and running them among multiple emulators all by hand, is there a tool or technique to do this automatically within Eclipse? 回答1: If you are going the "manual splitting" way, you may want to look at EclipseRunner. Have your different emulators as separate launch configs and run them as group afterwards. Alternatively you can use CDTs launch groups nearly the same way (and you avoid using the full CDT by installing

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

False positives: junit.framework.AssertionFailedError: EditText is not found

时光总嘲笑我的痴心妄想 提交于 2019-12-13 14:24:18
问题 I have a problem setting up Robotium tests to run on Travis without random false posivities. Every couple of builds I get pl.mg6.agrtt.TestActivityTests > testCanEnterTextAndPressButton[test(AVD) - 4.4.2] FAILED junit.framework.AssertionFailedError: EditText is not found! at com.robotium.solo.Waiter.waitForAndGetView(Waiter.java:540) on all my tests. I have created a simple project on GitHub to show the issue. You may see how it builds on Travis. Note build #7 failed after modyfing unrelated

Android - issue in controlling builtin app using Robotium

孤街醉人 提交于 2019-12-13 06:41:17
问题 I am writing an android testing application which automates testing on the device. I am targeting facebook as my base application and writing an app using the Robotium framework in order to accomplish my requirement. Until now i have successfully implemented a few features, but I am stuck at one point: I want to automate the "upload picture" functionality, but as soon as the upload button is clicked, the device builtin application gets activated. I could not control the default app using

Android Testing: Inflate and Display a custom Toast from Instrumentation

帅比萌擦擦* 提交于 2019-12-13 05:04:15
问题 I am trying to display a custom Toast but doing so from my automated test rather than from the application itself. The layout inflation does not work though. Is it even possible to inflate views and from the test project and display those? What does work is a standard Toast: final Activity targetActivity = Solo.getCurrentActivity(); // Using Robotium to get current displayed Activity Toast.makeText(targetActivity, "Hello from Instrumentation", Toast.LENGTH_SHORT).show(); What does NOT work is

How to check if an application got closed and returned to device application list using robotium?

被刻印的时光 ゝ 提交于 2019-12-13 04:40:02
问题 Is there any way to check whether an android application got closed and returned to device application list using robotium? 回答1: There is no direct way, however two ideas came to my mind. First: private boolean isApplicationClosed() { return solo.getCurrentViews().size() == 0; } Second (this may affect your application): private boolean isApplicationClosed() { try { solo.clickOnScreen(100, 100); } catch (AssertionFailedError e) { if("Click can not be completed!".equals(e.getMessage().trim())

How do I get a reference to a fragment from within a unit/robotium test?

筅森魡賤 提交于 2019-12-12 21:09:41
问题 How do I get a reference to a fragment within Robotium unit test. In my case the fragement houses a WebView. I want to use solo to get reference to the fragment? How can this be done? btw, I have asked three robotium/android questions before without a vote up and without a response! Lets not neglect testing. At least value the question please. 回答1: I have been away from robotium (and SO) for a little while but you used to be able to do the following because robotium has no inbuilt way to get

Activity doesn't restart in different tests with Robotium

前提是你 提交于 2019-12-12 20:04:54
问题 I'm testing my app's Login with Robotium and I'm having some problems. I've got two different user types so I've made 3 tests. One for each type and another failed login. If I execute them individually they all success, but if I run all the test case it runs one, executes the tearDown(solo.finishOpenedActivities) and it doesn't restart the activity to execute the other tests. So in the second test when I'm asking for a EditText it says that is not available. Here is my code: public class