robotium

Unlocking the emulator or device for Android test

╄→尐↘猪︶ㄣ 提交于 2019-12-12 16:15:56
问题 I am writing Android functional tests. I need the device to be awake and the application to be visualized in order for them to work. I have consulted with Android developers for that. However, there are several problems with the proposed solution: The proposed method now has several deprecated methods. Android API now advises me to use flags on the window: This class was deprecated in API level 13. Use FLAG_DISMISS_KEYGUARD and/or FLAG_SHOW_WHEN_LOCKED instead; this allows you to seamlessly

How to write test cases for the home screen activity using Robotium in Android

痞子三分冷 提交于 2019-12-12 14:27:01
问题 I am working on Robotium to write the test cases for one of the Android application. My requirement is to write the test suits for the lock screen and home screen with my test case. But I am unable to get home screen events and lock screen dragging through my instrumentation test case. 回答1: The lock screen is not a normal application, so you won't be able to instrument it (which means you can't test it using robotium). The home screen is part of the Launcher app, and you should be able to

Stackoverflow error when using comp.clickOnActionModeOverflowMenuItem(String Text) of Robotium-actionbarsherlock extension

时光总嘲笑我的痴心妄想 提交于 2019-12-12 10:19:47
问题 Here is a test function I'm trying to run public void testdeleteSingleDocument () throws Exception { Reusable_AddNew addDoc = new Reusable_AddNew(solo); Reusable_FolderAndDocumentActions delDoc = new Reusable_FolderAndDocumentActions(solo); Reusable_HelpFunctions Help = new Reusable_HelpFunctions(solo); addDoc.navMenuClick(); String Document = "My Document"; Help.clearAll(); addDoc.createDocument(Document); addDoc.appLaunch(solo); delDoc.deleteItem(Document); } and this is the delete function

How do I write a Solo/Robotium testcase that uses the builtin camera to take a picture?

别来无恙 提交于 2019-12-12 09:56:34
问题 From my activity I do startActivityForResult(MediaStore.ACTION_IMAGE_CAPTURE), and then I land in the builtin camera activity (in this case in the emulator). When I now do: "solo.clickOnButton(0);" in my testcase, it does not find ANY button (null is found for index=0). How do I write a Solo/Robotium testcase that uses the builtin camera to take a picture ? 回答1: according to the Robotium doc you cannot do this as this spans two applications ( your one and the default camera activity ). See

How to resolve Exception during suite construction?

不问归期 提交于 2019-12-12 09:40:14
问题 I have followed the below steps to test my app. I have created Android Project. I have created the debug signature for my sample app and test app(which need to be tested) Place the sampleapp_debug.apk in the bin folder (where my workspace is there) Installed the testapp_debug.apk in the emulator. Now i am running the project as a Android JunitTest. I am getting the below error.. How to resolve this.. java.lang.RuntimeException: Exception during suite construction at android.test.suitebuilder

Android test project is crashing with error “Test run failed: Instrumentation run failed due to 'Process crashed.'”

末鹿安然 提交于 2019-12-12 08:21:10
问题 My problem seems little different than here Test run failed: Instrumentation run failed due to 'Process crashed.' when testing multiple Android activity I have followed steps given in the pdf. I have created test project "TestAndroidCalculatorBlackbox" (do we need to have two project one test and one main project, perhaps this could be the reason, cause in Robotium "Getting Started" link they want us to create projects for Notepad), and added jars robotium-solo-5.0.1.jar , robotium-solo-1.6.0

cannot run as debug robotium junit test

限于喜欢 提交于 2019-12-12 03:39:01
问题 I guess this is a duplicate with I can run Robotium test but cannot debug it but there is no valid answer for it. I have a application that I can test with robotium. (Run as Android Junit Test the test runs fine) If I try Debug As Android Junit Test, the application does not start, eclipse appears to be stuck launching the tests. Can you tell me the steps in order to run my test in debug mode (I want to debug the test, not the app)? 回答1: So there is two requirement to get this to work: 1. you

Android Unit Test : Instrumentation failed due to a class error

不打扰是莪最后的温柔 提交于 2019-12-12 02:42:35
问题 I am running a test using Robotium on an android emulator. When I run my test I get an error saying "Test failed to run to completion.Reason: Instrumentation failed due to com.example.android.businesslogic.TestBL$1 I check the logcat for error's and I see following W/ActivityManager( 51) com.example.android.businesslogic.TestBL$1 W/ActivityManager( 51) java.lang.NoClassDefFoundError: com.example.android.businesslogic.TestBL$1 My application has no error and can run smoothly, its just when I

Is it possible to execute the test using Robotium without PC. Just my Android device only

你。 提交于 2019-12-12 02:28:33
问题 Can I execute my test without using command line or not connected to PC? Just using only my Android device. 回答1: Yes, It is possible Install DevTools App more details here After installing the test apk open "devTools" -> Instrumentaion and select "android.test.InstrumentationTestRunner' . 来源: https://stackoverflow.com/questions/9632566/is-it-possible-to-execute-the-test-using-robotium-without-pc-just-my-android-de

Handle random Dialogs using Robotium

a 夏天 提交于 2019-12-12 01:34:27
问题 I am try yo test the login scenario using Robotium. My confusion is that, how could I test following: Case 1: If some error occurs during the web service call and a dialog is displayed randomly, how can I handle that. As I'm not sure if this dialog will appear. Case 2: If this thing is handled, will the test be a fail or a pass? Because for a successful login, user should navigate to next screen. 回答1: You know when and where this dialog can happen so its possible to place in code to handle