Appium automated start-up mobile app note

Source: Internet
Author: User

Java Startup method

1. Need to install Jar


2. Start as follows:

public class Initdriver {

public static androiddriver<androidelement> Initdriver () throws exception{

File App=new file ("Install your own package. apk");

Desiredcapabilities caps=new desiredcapabilities ();

Caps.setcapability (Mobilecapabilitytype.device_name, "Android");

Caps.setcapability (Mobilecapabilitytype.app, App.getabsolutepath ());

Caps.setcapability (Mobilecapabilitytype.automation_name, "Appium");

Caps.setcapability (Mobilecapabilitytype.udid, "127.0.0.1:62001");

Caps.setcapability (Mobilecapabilitytype.new_command_timeout, 600);

Caps.setcapability (Mobilecapabilitytype.full_reset, true);

Caps.setcapability (Androidmobilecapabilitytype.app_package, " package name ");

Caps.setcapability (androidmobilecapabilitytype.app_activity, " signature ");

Caps.setcapability (Androidmobilecapabilitytype.unicode_keyboard, true);

Caps.setcapability (Androidmobilecapabilitytype.reset_keyboard, true);

Caps.setcapability (Androidmobilecapabilitytype.no_sign, true);

Androiddriver<androidelement> driver=new androiddriver<androidelement> (

New URL ("Http://127.0.0.1:4723/wd/hub"), caps);

return driver;

}

}

Iii. obtaining registration and signing orders:

AAPT d badging desktop\xxxxx.apk |findstr "Package launchable-activity"

Such as:

AAPT d badging desktop\toon-beijing-test.apk |findstr "Package launchable-activity"

Package:name= ' package name ' versioncode= ' 1709111541 ' versionname= ' 1.8.0 ' platformbuildversionname= ' 7.1.1 '

Launchable-activity:name= ' signature ' label= ' icon= '


Four Appium start mode:

Appium-a 127.0.0.1-p 4723–u 4ca1558c--no-reset

V:configuration and meaning of desiredcapabilities parameters


1, the local installation apk package file path settings, do not need to install without setting

File Classpathroot = new file (System.getproperty ("User.dir"));
File Appdir = new file (Classpathroot, "apps");
File app = new file (appdir, "kingyee.apk");

2. Do not reset the app status before the current session

Capabilities.setcapability ("NoReset", true);

3, testing the Web Browser , if the test app is ignored

Capabilities.setcapability (Capabilitytype.browser_name, "");

4. Platform Settings IOS, Android, or Firefoxos

Capabilities.setcapability ("PlatformName", "Android");

5. Device Serial Number setting
Capabilities.setcapability ("DeviceName", "baytrail515b4e05");

6. System version number setting
Capabilities.setcapability ("Platformversion", "4.4.4");

7. Avoid re-signing

capabilities.setCapability("noSign","true");

8. Support Chinese input
Capabilities.setcapability ("Unicodekeyboard", "True");

9, reset the input method to the original state
Capabilities.setcapability ("Resetkeyboard", "True");

10. Set the APK package name
Capabilities.setcapability ("Apppackage", "COM.KINGYEE.M");

11. Set Startup activity
Capabilities.setcapability ("Appactivity", "Com.kingyee.m.start");



This article is from the "Know the Ming" blog, please be sure to keep this source http://357712148.blog.51cto.com/6440370/1968237

Appium automated start-up mobile app note

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.