robotium

Fast scroll in Robotium

谁说我不能喝 提交于 2019-12-11 06:19:29
问题 I have created a test project for my Android project. In my app there is a listview that has a lot of data. I need to scroll this listview up and down using Robotium. I have used the scrollUp() and scrollDown() functions, but it is scrolling too slowly. I am using Robotium 3.3. Is there any way to make a fast scroll? 回答1: int screenWidth = getActivity().getWindowManager().getDefaultDisplay().getWidth(); int screenHeight = getActivity().getWindowManager().getDefaultDisplay().getHeight(); int

NAF Nodes, Automation with Robotium

半城伤御伤魂 提交于 2019-12-11 04:54:55
问题 I'm having a problem in accessing some components on my UI using Robotium. I discovered there are some nodes (NAF nodes) that are not accesible from automated tool as Robotium. Is there a way to access them? I would not use click using specific coordinates. Could you suggest me the best practices for problems like this? This is the image of layout seen from UI Automator. 回答1: If you want to access the elements of a particular list view the following code should help you achieve that: ListView

Robotium - Trying to click home button in app

那年仲夏 提交于 2019-12-11 04:28:56
问题 I'm new to robotium and i'm trying to write a quick and dirty script to run through all screens in an app. The problem i have mainly with the 'home button' in the app. I've tried lots of options but i cant seem to get it to click there except with index, which is not what i want. When i check out the button with the hierarchyviewer it looks like this: Link However when i try for example: assertTrue( "Wait for text (id: myapp.R.id.home) failed.", solo.waitForImageById("myapp.R.id.home", 20000)

testing with mock in robotium

那年仲夏 提交于 2019-12-11 03:40:19
问题 i am using mock for my test in Rbotium. My first test fail and another test pass. i think it is because of that the mock is not ready for the test. but when i add a fake test all of my tests passes. my fake test: public void test_ShowA_HomeActionbarTabClicked() { assertEquals("",""); } all tests: public void test_ShowCategoryGamesListFragment_CategoryListActionbarTabClicked() { //click on Categories action bar tab getSolo().clickOnText(getSolo().getCurrentActivity().getString(R.string.title

Robotium: Problems with importing Android Robotium project from Eclipse into IntelliJ

删除回忆录丶 提交于 2019-12-11 03:06:37
问题 I've got project originally written in Eclipse as a separate Robotium project for the application project, that need to be tested. I wanted to import it into IntelliJ IDEA. The problem with IDEA is connected with visibility of that application project, I guess. I've added it as a module dependency, as suggested here. But it didn't help. IDEA still throws compilation errors like: type parameter com.***.MyActivity is not within its bound cannot find symbol constructor Solo(android.app

could not be found or has no tests in Junit

不羁岁月 提交于 2019-12-10 22:39:47
问题 I am trying to test setting application using JunitTestcase .My class extends ActivityInstrumentationTestCase2 . But while executing I am getting this error: 01-12 17:22:11.519: WARN/TestGrouping(2942): Invalid Package: '' could not be found or has no tests 01-12 17:22:11.539: INFO/ActivityManager(1620): Force stopping package com.android.settings uid=1000 Can any one suggest a solution for this?. 回答1: You have to specify the app to be tested in the AndroidManifest of the testing project..

Robotium: HowTo create a test project for an existing project in Intellij IDEA?

泪湿孤枕 提交于 2019-12-10 22:36:51
问题 I'm stuck in creating a test project for an existing one. For Eclipse it was simple, but for IntelliJ(and I'm forced to use it at my workplace) I don't really know how to test the project using Robotium framework. I would appreciate if anyone can write few clear steps in order to explain this. 回答1: In IntelliJ, you create modules for this. File -> Add Module -> Create Module from Scratch -> Android -> Test For setting up Robotium in your new test project, open up File -> Project Structure ->

How to elegantly wait for test case to finish after call to startInstrumentation

喜你入骨 提交于 2019-12-10 22:08:48
问题 I have a set of apps, each with associated test case instrumentation. I'm launching the instrumentation programmatically from yet another "launcher" app (implemented as a service), using startInstrumentation() as in this example: https://stackoverflow.com/a/9815087/1536475 This works just fine for launching one test case. What I would like is for the launcher to run test case 1, wait for the test to complete, then run test case 2. What's holding me back is that startInstrumentation() returns

Robotium for Android - solo.searchText () not working

一曲冷凌霜 提交于 2019-12-10 20:59:04
问题 I'm having a problem with searchText() function used with Robotium. I'm searching for this string: <string name="provisioning_wizard_title_2">Service Activation Wizard (Step 2)</string> I defined it in string xml, and I'm searching it this way: Activity act=solo.getCurrentActivity(); String string = solo.getString(act.getResources().getIdentifier("provisioning_wizard_title_2", "string", act.getPackageName())); It fails when I call assertTrue(solo.searchText(string)); and it fails also if i

Robotium test cannot find activity class

喜欢而已 提交于 2019-12-10 19:32:18
问题 I have been using robotium to test my android application. I found it very useful tool so far. Recently we have done a refactoring that would use only one activity in the entire application, each page will be replaced by a fragment. However, After we start using that activity to run the unit tests, the test complains NoClassDefound error -- it couldn't find the activity class. I don't see anywhere I have change the configuration whatsoever. Can anybody give a clue what might be wrong , where