robotium

How to use MonkeyRunner and Robotium together (not separately!)

不羁的心 提交于 2019-12-12 01:29:16
问题 How to use MonkeyRunner and Robotium together (not separately!) for testing my Android app 回答1: Well, I found this http://download.yandex.ru/company/experience/yac2012/kharitonenko_yac_2012.pdf slide #22. There is a scheme, how to use a combination of Robotium and Monkeyrunner. For example, when in your tests, you need to take a snapshot from Android native Camera, and Robotium can't do that. Monkeyrunner can do it. But most of your test case developed in Robotium, so as I understood, you can

junit.framework.AssertionFailedError while testing back button on android

浪子不回头ぞ 提交于 2019-12-11 19:13:35
问题 i am new to Robotium.I'm facing an issue "junit.framework.AssertionFailedError" while executing the test case which using Robotium.Test scenario is checking Back button functionality.here's my code package com.example.test; import android.test.ActivityInstrumentationTestCase2; import android.widget.EditText; import com.jayway.android.robotium.solo.Solo; import com.example.app.R; import com.example.app.LoginActivity; import com.example.app.AccountCardListActivity; import com.example.app

How to verify redirection to Google Play Store

你离开我真会死。 提交于 2019-12-11 18:09:27
问题 Using Robotium, how do I check the redirection to Google Play Store? Steps: Click on a link from a listview from the test app. Verify it redirects to Google Play Store. I noticed that while Google Play Store is open, my test app is actually open underneath also. (I printed out all the views) Therefore, I cannot do "assert xyz view from test app does NOT exist". How do I check the redirection to Google Play? 回答1: Is it possible? sort of, unfortunately robotium makes it very hard to do so

Called from Wrong Thread Exception in Robotium Testcase

∥☆過路亽.° 提交于 2019-12-11 18:02:41
问题 I'm writing Testcase using Robotium for my android app which has multiple activities. The app implements Drawer in UI. But when solo opens drawer, it gives the exception Called From Wrong Thread Exception . Drawer loads when ActionBar Home is clicked. public void test4Drawer() { solo1.clickOnActionBarHomeButton(); Boolean actual=solo1.searchText("About"); Boolean expected =true; assertEquals("Drawer Not Loaded",expected,actual); } 回答1: In you setUp(): mActivity = getActivity(); And in you

Robotium How to test with background Services like conversion?

梦想的初衷 提交于 2019-12-11 13:53:02
问题 I am using Robotium Recorder to test my app. My problem is in my app i am doing audio conversions in background which take some time based on how much time user is recording. Example If i am running a test which records for 10mins (Converts in background) each time like this 10 times it records so when my last recording that is 10th recording finishes robotium exits and kill the app. **Problem:- For last recording my file still need to convert its converting in background (Service) but app is

Testing activity flow with robotium

本秂侑毒 提交于 2019-12-11 12:45:36
问题 I want to test some flow using robotium my flow has to go through several activities, and do some assertions in the middle my problem is, that once the activity changes, the test ends successfully how do i test going through several activities in 1 test? i am using robotium 5.0.1 回答1: Its quite simple to achieve. You can fire event and check result using assert API inside one method public void testAllActivity(){ Solo solo = new Solo(getInstrumentation(), getActivity()); // View1 is a view

How to open navigation drawer menu in Robotium automation script in android

匆匆过客 提交于 2019-12-11 11:28:28
问题 I have a application with navigation drawer i want to open the drawer menu in Robotium automation script.my application minimum Api level is 11 so i am using action bar sherlock for action bar implementation. Please guide me in right way 回答1: none of the methods mentioned in documentation seem to work. Best option is to swipe rightwards private void swipeToRight() { Display display = solo.getCurrentActivity().getWindowManager().getDefaultDisplay(); int width = display.getWidth(); int height =

How to catch exceptions using ActivityInstrumentationTestCase2?

我是研究僧i 提交于 2019-12-11 11:16:22
问题 I'm struggling to catch expected exceptions in test cases of my Android app using the class ActivityInstrumentationTestCase2. I wrote a very simple scenario that is raising the issue, and once this is solved I can probably do the same thing for my app. The snippet of the simple scenario is below. First, there is the application that I want to test, which raises a NullPointerException in its onCreate method. package com.example.crashtest; import android.app.Activity; import android.os.Bundle;

android monkey script for multiple devices

隐身守侯 提交于 2019-12-11 11:15:53
问题 Can some body can help me for to put android monkey test for multiple devices ? ->adb shell monkey -p com.example -v 500000 So here i have connected 10 devices in my PC. I wanted to run monkey test for all the device and capture the logs at the same time. Can any one suggest me on this ? 回答1: Use a script like this: #! /bin/bash for s in s1 s2 s3 do adb -s $s shell monkey -p com.example -v 500000 > $s.log done where s1, s2, ... are the serial number of your devices 来源: https://stackoverflow

How to run Android JUnit tests from multiple projects in eclipse?

为君一笑 提交于 2019-12-11 10:37:50
问题 I'm wondering how to run multiple projects containing Android JUnit Robotium test from eclipse at once... I hope someone could help. Thanks a lot! 回答1: I was caught up in the similar situation. I used command line to run my test. You can use the following commands For a single Test adb shell am instrument -e your class -w your package/android.test.InstrumentationTestRunner For all your Tests adb shell am instrument -w your package/android.test.InstrumentationTestRunner Hope it helps. 回答2: You