robotium

Robotium 测试多个activity

邮差的信 提交于 2019-12-02 05:31:12
How to test two activities with Robotium : http://stackoverflow.com/questions/16019011/how-to-test-two-activities-with-robotium //Click on add ident button solo.clickOnButton("Tap to get another number"); if (solo.waitForActivity(IdentityTemplateActivity.class)) { // select ident type solo.clickOnImageButton(0); // add name/label and create ident if (solo.waitForActivity(NumberDetailActivity.class)) { solo.enterText(0, "Robotium"); solo.enterText(1, "test 1"); solo.clickOnImageButton(6); } } 来源: oschina 链接: https://my.oschina.net/u/855532/blog/411958

Getting started with Robotium. EditText not found

拟墨画扇 提交于 2019-12-02 03:06:29
I just getting started with Robotium, writing my first test and I'm getting this weird error: junit.framework.AssertionFailedError: 2131165500 EditTexts are not found! This is my my test case public class TestRegistrationActivity extends ActivityInstrumentationTestCase2<RegistrationActivity>{ private Solo solo; public TestRegistrationActivity() { super(RegistrationActivity.class); } public void setUp() throws Exception { solo = new Solo(getInstrumentation(), getActivity()); } @Override public void tearDown() throws Exception { solo.finishOpenedActivities(); } @UiThreadTest public void

How to handle external application activity in android using robotium

怎甘沉沦 提交于 2019-12-02 01:11:33
问题 I am trying to automate android app(Relocation services)using robotium. In this app there are media section and email and phone native dialer options so when i click on any of this option(Video, audio, phone, email) it takes you to the native app(video,audio, phone, email) of the phone. So how to handle external application activity using robotium(Like click on back button to come back to my app, or close native camera or video app to come back to my app) Any answer will be great help. 回答1: I

I can run Robotium test but cannot debug it

送分小仙女□ 提交于 2019-12-01 23:00:14
I'm testing an apk for which I don't have sources on my phone. I have ensured that I have the same certificates in both the test and app apks. I'm able to run my tests fine from eclipse, but when I try to debug through "Debug As", eclipse appears to be stuck launching the tests. In the progress bar at the bottom, I see "Launching: Creating source locator...". I have set breakpoints in the appropriate spots, and nothing that I can see in the logcat output to suggest that there's a crash in either the test process or the app process. Any ideas on what the problem might be or how to investigate

how to create a robotium testsuite?

妖精的绣舞 提交于 2019-12-01 22:39:42
with the code below, the tests are not executed in the order I'd like. test_homescreen is executed before test_splashscreen. I'd like to specify the tests to run and their order of execution. I believe I need to create a testsuite, but I don't know how to implement that. package com.myapp.test; import com.jayway.android.robotium.solo.Solo; import android.test.ActivityInstrumentationTestCase2; import com.myapp.R; public class myTest extends ActivityInstrumentationTestCase2{ private static final String TARGET_PACKAGE_ID="com.myapp.test"; private static final String LAUNCHER_ACTIVITY_FULL

Android Robotium: how to go back to my Activity under test after clicking/launching another Activity

筅森魡賤 提交于 2019-12-01 21:19:30
I have an issue with my Robotium tests. On one of my Activity A, I am clicking on a button. Clicking on this button launches another activity B. So in my robotium test I have something like this : Button myBtn = (Button) solo.getView(R.id.myBtn); so after this action, the emulator is automatically launching activity B. Now, the problem is that I do not have any possibility of going back to the activity under test (A) in the code. Can you please tell me how to avoid getting jailed in the activity B when clicking on the button that trigger its launch ? In other words, is it possible to go back

Android Robotium - How to manage the execution order of testcases?

。_饼干妹妹 提交于 2019-12-01 18:43:26
I am trying to use Robotium to automate the testing of an application. The test cases were documented and they are supposed to be test in specific order. But it seems that Junit run the tests in alphabetic order.. how do I rearrange the order of execution? Here is the basic structure of my test class: public class ETTerminalTest extends ActivityInstrumentationTestCase2<IdleActivity> { private Solo solo; private static final Logger LOGGER = LoggerFactory.getLogger(ETTerminalTest.class); public ETTerminalTest() { super("com.employtouch.etterminal.ui.activity", IdleActivity.class); } protected

Android Espresso testing app flow

坚强是说给别人听的谎言 提交于 2019-12-01 18:14:19
I use Espresso to test a lot of activities and transitions between them. I want to write different test for those activities and link the Activity Intents to the corresponding test cases. 1 . Activity A (testActivityA runs) 2. ActivityA launches ActivityB (testActivity B) should be called is it possible to do this with espresso or any other test framework? 来源: https://stackoverflow.com/questions/32131857/android-espresso-testing-app-flow

Android Espresso testing app flow

落花浮王杯 提交于 2019-12-01 17:16:34
问题 I use Espresso to test a lot of activities and transitions between them. I want to write different test for those activities and link the Activity Intents to the corresponding test cases. 1 . Activity A (testActivityA runs) 2. ActivityA launches ActivityB (testActivity B) should be called is it possible to do this with espresso or any other test framework? 来源: https://stackoverflow.com/questions/32131857/android-espresso-testing-app-flow