robotium

Examples for Robotium

限于喜欢 提交于 2019-12-03 06:15:35
问题 I found a tool for Instrumentation Testing called Robotium.It is easy and simple for black box testing of android applications. We can use it as follows: solo.clickOnText("Other"); solo.clickOnButton("Edit"); assertTrue(solo.searchText("Edit Window")); solo.enterText(1, "Some text for testing purposes") solo.clickOnButton("Save"); assertTrue(solo.searchText("Changes have been made successfully")); solo.clickOnButton("Ok"); assertTrue(solo.searchText("Some text for testing purposes")); Can any

Robotium + Android studio

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I run robotium (5.2.1) tests from android studio 1.0 RC 2, I get this following error ==> :app:shrinkDebugTestMultiDexComponents FAILED Error:Execution failed for task ':app:shrinkDebugTestMultiDexComponents'.> java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options? I have no problem to run the application "in normal mode". Do you know where is my problem ? Thx in advance EDIT According to Jared Burrows's answer I can pass task shrinkDebugTestMultiDexComponents but now I have this problem :app

Unable to get Robotium to work in Android Studio

。_饼干妹妹 提交于 2019-12-02 22:14:24
I'm struggling to get Robotium to work on the gradle-based Android Studio and I can't find the way to do it This is my build.gradle file buildscript { dependencies { repositories { mavenCentral() mavenLocal() } classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() /* maven { url "https://oss.sonatype.org/content/repositories/snapshots" }*/ } sourceSets { testLocal { java.srcDir file('src/test/java') resources.srcDir file('src/test/resources') } } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 15

Interface Android robotium testing with Teamcity

和自甴很熟 提交于 2019-12-02 21:10:38
As this was not answered (Maybe did I not find it) previously, I investigated on the following question : How to perform automated functional tests on Android devices with robotium, and report them to continuous integration server like TeamCity? As I did not find any answer on that specific question, I investigated. Here is the output of my investigation and a quick How-To in order to help people perform automated functional tests on Android applications using robotium, and then report the results to a continuous integration server like TeamCity. Please note that this may not be the best

Examples for Robotium

时光毁灭记忆、已成空白 提交于 2019-12-02 19:41:09
I found a tool for Instrumentation Testing called Robotium.It is easy and simple for black box testing of android applications. We can use it as follows: solo.clickOnText("Other"); solo.clickOnButton("Edit"); assertTrue(solo.searchText("Edit Window")); solo.enterText(1, "Some text for testing purposes") solo.clickOnButton("Save"); assertTrue(solo.searchText("Changes have been made successfully")); solo.clickOnButton("Ok"); assertTrue(solo.searchText("Some text for testing purposes")); Can any body have more idea about it? Can any one please tell how can we use it for webviews and listviews etc

Robotium + Android studio

这一生的挚爱 提交于 2019-12-02 17:42:53
问题 When I run robotium (5.2.1) tests from android studio 1.0 RC 2, I get this following error ==> :app:shrinkDebugTestMultiDexComponents FAILED Error:Execution failed for task ':app:shrinkDebugTestMultiDexComponents'.> java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options? I have no problem to run the application "in normal mode". Do you know where is my problem ? Thx in advance EDIT According to Jared Burrows's answer I can pass task

Robotium - testing specific flavors in Android Studio with Gradle

此生再无相见时 提交于 2019-12-02 09:56:58
So... i'm trying to make some tests for my application. I have several flavors in my application, and I want to build individual tests for each flavor. From the Robotium documentation I used the "androidTest/java" folder with a package inside... I event tried after some suggestions to input a flavor's .test. Another suggestion from here: http://tools.android.com/tech-docs/new-build-system/user-guide was to make several folders named "androidTest", but it didn't worked. I have the latest Android Studio with Gradle 2.2.1. I want to start 1 test to run for a single flavor. Currently in all the

how to restart killed android application in testing with robotium

蓝咒 提交于 2019-12-02 09:38:01
问题 I am testing an apk using robotium. In this app, I have a button which kills the app process and relaunches it. I want to test this scenario using robotium. When I click on the button through robotium, app is killed as expected but I cannot see that- it relaunches. 回答1: You cannot do this via robotium, Instrumentation tests live in the same process as your application (you can see this if you look at logcat) this means that when you kill your applications process the tests die along with it.

Robotium + Android studio

风格不统一 提交于 2019-12-02 09:00:25
When I run robotium (5.2.1) tests from android studio 1.0 RC 2, I get this following error ==> :app:shrinkDebugTestMultiDexComponents FAILED Error:Execution failed for task ':app:shrinkDebugTestMultiDexComponents'.> java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options? I have no problem to run the application "in normal mode". Do you know where is my problem ? Thx in advance EDIT According to Jared Burrows's answer I can pass task shrinkDebugTestMultiDexComponents but now I have this problem :app:packageAllDebugTestClassesForMultiDex FAILED Error:Execution

How do I click the first item in a spinner using Robotium?

主宰稳场 提交于 2019-12-02 06:31:46
I am having problems scrolling up in a spinner to select the first item in a Robotium test case. Here is my code: int pos = solo.getCurrentSpinners().get(0).getSelectedItemPosition(); solo.pressSpinnerItem(0, 0 - pos); pos is 1 when I debug, but Robotium still presses the spinner on index 1 even though I order it to press on -1. What am I doing wrong? Thanks Markus Seems they took those classes out now. Just ran into this myself but found a way to do this properly and generically. // 0 is the first spinner in the layout View view1 = solo.getView(Spinner.class, 0); solo.clickOnView(view1); solo