Robotium provides two ways to work (a test with active code, a test without source code)Need to re-sign without source codeMode 1 Test with source codeActive code testing (here is an example of the official website Notepad apk)Open EclipseImport official website Notepad apk projectFile---ImportGeneral---Existing Projects to WorkSpaceSelect Source Project Storage PathClick FinishDelete Original apkRecompile to generate a new apkProject----ClenaSelect t
Robotium is based on the instrumentation framework, and its test scripts are written in the same process as the program being tested, so this requires the test program to have the same signature as the program being tested, otherwise it will not be able to communicate.In the case of APK only, the program can be signed with the method of "sign and sign again". And no sign of the APK is not loaded into the phone.Do you want to ask why the apk I packaged
Several representations of ID in Robotium 1) string form: For example Id/btn_example, the source of the layout in some of the hierachy see is this. 2) Digital form: For example 0x7f0700d, open R.java inside reflects the string form and int form correspondence relation. White box test, directly use the form of r.id to call the View View =solo.getview (r.id.btn_example);//Get Viewsolo.clickonview (view);//Click on the Black box test, r.id Invisible Acti
Community 2. Robotium test (function test, User Acceptance Test, black box + white box test)-Rating: 8Web: https://code.google.com/p/robotium/Pros:
Quite popular for android testing
You can test the source code or apk.
Android Native and Android Hybrid App can be tested
Allows you to test network connections and sounds.
Open Source
Active Communities and good materials 3. AndroidTest (
1. Configure the Android SDK, Java environment2. Re-sign the apk fileIn the user directory, there will be a. Android directory, put Re-sign.jar in the directory. Execute command Java-jar Re-sign.jarThen take the apk file off to the open re-sign. Save the re-signed file.Note that the pop-up needs to be followed by the following.You can also use scripts to manipulate them directly. The bat script is as followsBAT script and Re-sign.jar in the same directory.@echo Offecho "your. Android directory i
When testing with Robotium, to export visual test results, you can use Junitreport to implementJunitreport:https://github.com/jsankey/android-junit-reportWe follow the previous writing test steps to use Robotium, repeated here no longer repeat.1. 将junitreport添加到工程的libs目录中2. 将junitreport-xxxx.jar添加到build_path中(右键此文件,Build Path->add to build path3. 修改测试工程中AndroidManifest.xml文件,如后面xml修改处下4. 修改工程Run Configure中,
Source
You can write test code in different languages
can test different platform program: Android/ios/web/hybrid
More active Communities
2. Robotium Test (functional test, user acceptance test, black box + White box test)-Rating:8website:https://code.google.com/p/robotium/Pros:
Quite Popular for Android testing
You can test the source code, or you can test the APK
Can tes
/hybrid
The community is more active 2. Robotium Test (functional test, user acceptance test, black box + White box test)-Rating:8website:https://code.google.com/p/robotium/Pros:
Quite Popular for Android testing
You can test the source code, or you can test the APK
Can test Android native and Android Hybrid App
Can test network links and sounds, etc.
Open Source
The community
To configure the Robotium environment on your Mac, here are a few things to keep in mind:
Installation of Java JDK+JRE and setting of environment variables
Installation of Eclipse
Extensions and installation of the Android SDK and ADT on eclipse
Settings for the Android environment variable
Eclipse/mac settings on the An Zuojin machine: http://my.oschina.net/u/855532/blog/403077
APK anti-compilation: http://my.oschina.net/u/855532
text of the given element. */Public String GetText (Viewnode node) {if (node = = null) {throw new RuntimeException ("Node not fo und "); } viewnode.property Textproperty = Node.namedProperties.get ("Text:mtext"); if (Textproperty = = null) {//Give it another chance, ICS viewserver returns mText Textproperty = n Ode.namedProperties.get ("MText"); if (Textproperty = = null) {throw new RuntimeException ("No Text property on Node"); }} return textproperty.valu
Today, when using Robotium to test the fragmentactivity, the class cannot find an exception. Toss a half-day, finally find a solution, the android-support-v4 selected to remove on the line. Base class Encapsulation Publicabstractclassbaseinstrumentationtestcase Android Robotium Fragmentactivity
Transplantation of MonkeyRunner's image comparison and implementation of Sub-graph acquisition functions-UiAutomator/Robotium,
According to the previous article titled image comparison for porting MonkeyRunner and implementation for acquiring subgraphs-Appium, because Appium and MonkeyRunner have one thing in common-the code control process is implemented on the client. Therefore, it is very easy to transplant the image comparison and subgraph acquisi
Transferred from: http://blog.sina.com.cn/s/blog_68f262210102v75t.htmlRecently learned the Robotium test framework, of course, before learning any framework or language, the first step is to build the environment. But in the process of setting up the environment, I encountered a problem: After creating an Android test Project, a dialog box will pop up to report the error on the face:Errors running builder ' Android Resource Manager ' On Project XXXThe
MonkenRunner's methods and suggestions for locating controls through HierarchyViewer (Appium/UIAutomator/Robotium companion), uiautomator1. Background
When using MonkeyRunner, we often use the HierarchyViewer module under Chimchat to obtain information about the target control to help us test, but on MonkeyRunner's official website does not see the corresponding API description, above only the following three classes of API reference information (http
Tag: Reg order number func NES pad run add listDirectory of this document
1. run all the test cases
2. run a single test class or a testsuite
3. run A test method inside a test class
4. run a method in two different test classes or classes
Command line run Android robotium Automation use case or unit Test case1.RunAll theTestCaseGive me a chestnut: run All the use cases under the test project
1
adb shell
; 3Solo.setprogressbar (0, 65); 4 //Solo.clickonscreen (121, 80); 5 //Solo.drag (one, 121, he, 3);6 Booleanactual = Solo.searchtext ("Current ); 7Assertequals ("This isn't a found", expected,actual); 8}Note: After using Setprogressbar, you still hold the pressed state.Add a second Api:clicklongonscreenFunction: Hold down a coordinate point of the screen for a long timepublic void Clicklongscreen (float x, float y, int time)float X:X coordinatesfloat Y:y coordinatesint time: long and
the app you want to watch.3) Open Hierarchyviewer, click the Hierarchyviewer file. After the connection, for example, this figure is obtained in the official document.4) Double-click on the top, such as the 5) Look at the hierarchy chart, this diagram is a bit large and can be dragged. The View Hierarchy window shows all the view objects of the activity, and a view can be selected to see the details of the view, preferably the show Extras option in the tool.6) observe a single view and select a
Today we share a small problem with robotium.When we run from a well-built framework, there may be an error (as shown) that the class could not be found.The problem is that the re-signing tool gives the wrong activity, and we can use the appt command to see the activity of the re-signed APK, which is correct.1. Enter the folder with the Appt.exe program in the SDK installation directory2, input command AAPT dump badging D:\qq.unar_debug.apk. (Note: The storage path of the command +apk)3, can vie
prompt", "activity name ");Search whether the specified text existsSearchtext ("Search Text") or searchtext ("(? I ).*? Note 1 test ") followed by a regular expression10. Obtain(Edittext) Solo. getview (R. Id. edittext01 );(Textview) Solo. getview (R. Id. textview01 );Arraylist currenttextviews = solo. getcurrenttextviews (outputfield );11. Pay attention to the following two points when you click the button for testing:(1) During a real machine test, I found that I couldn't find the button afte
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.