Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install the configuration environment for Appium

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to install and configure the environment for Appium". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install the configuration environment for Appium.

Install AndroidSDK, AndroidSDK_installer_r24.4.1-windows.exe

Run "SDK Manager.exe" with Admistrator

Select SDK Tools, SDK Platform-tools, SDK Build-tools installation under Tools

Select SDK Platform installation under Android 7.11 (API 25)

Select SDK Platform,ARM EABI v7a System Image and Intel x86 Atom System Image installation under Android 5.1.1 (API 22)

This can be installed of your own choice.

Run "AVD Manager.exe" with Administrator

Select Nexus 4 under Device Definitions and click Create Device, enter the name, screen size, resolution, memory size.

Select the newly created Device under Device Definitions, then click Create AVD to create a virtual device, CPU/ABI select ARM (armeabi-v7a), and Skin select No Skin

Select Jinjian's virtual device under Android Virtual Devices, click Start, and start the device.

Add the environment variable ANDROID_HOME=C:\ Program Files (x86)\ Android\ android-sdk

Install nodejs

Install appium under nodejs

Npm install-g appium

Npm install-g appium-doctor

Run appium-doctor to check the environment

Info AppiumDoctor AppiumDoctor v.1.4.2

Info AppiumDoctor # Diagnostic starting #

Info AppiumDoctor? The Node.js binary was found at: C:\ Program Files\ nodejs\ node.exe

Info AppiumDoctor? Node version is 6.10.2

Info AppiumDoctor? ANDROID_HOME is set to: C:\ Program Files (x86)\ Android\ android-sdk

Info AppiumDoctor? JAVA_HOME is set to: C:\ Program Files\ Java\ jdk1.8.0_51

Info AppiumDoctor? Adb exists at: C:\ Program Files (x86)\ Android\ android-sdk\ platform-tools\ adb.exe

Info AppiumDoctor? Android exists at: C:\ Program Files (x86)\ Android\ android-sdk\ tools\ android.bat

Info AppiumDoctor? Emulator exists at: C:\ Program Files (x86)\ Android\ android-sdk\ tools\ emulator.exe

Info AppiumDoctor? Bin directory of JAVA_HOME% is set

Info AppiumDoctor # Diagnostic completed, no fix needed. # # #

Info AppiumDoctor

Info AppiumDoctor Everything looks good, bye!

Info AppiumDoctor

Run appium to start appium hub server

C:\ Program Files\ nodejs > appium

[Appium] Welcome to Appium v1.6.4

[Appium] Appium REST http interface listener started on 0.0.0.0:4723

Maven dependency

Io.appium

Java-client

4.1.2

Java

Import java.net.URL

Import org.openqa.selenium.remote.CapabilityType

Import org.openqa.selenium.remote.DesiredCapabilities

Import io.appium.java_client.MobileElement

Import io.appium.java_client.android.AndroidDriver

Public class AndroidDriverTest {

Public static void main (String [] args) throws Exception {

DesiredCapabilities capabilities = new DesiredCapabilities ()

Capabilities.setCapability (CapabilityType.BROWSER_NAME, "")

Capabilities.setCapability ("platformName", "Android")

Capabilities.setCapability ("deviceName", "Android Emulator")

Capabilities.setCapability ("platformVersion", "5.1.1")

Capabilities.setCapability ("appPackage", "com.android.calculator2")

Capabilities.setCapability ("appActivity", ".Calculator")

AndroidDriver driver =

New AndroidDriver (new URL ("http://127.0.0.1:4723/wd/hub"), capabilities))

Driver.findElementByAndroidUIAutomator ("text (\" 1\ ")) .click ()

Driver.findElementByAndroidUIAutomator ("text (\" +\ ")") .click ()

Driver.findElementByAndroidUIAutomator ("text (\" 2\ ")") .click ()

Driver.findElementByAndroidUIAutomator ("text (\" =\ ")") .click ()

System.out.println (driver.currentActivity ())

Driver.quit ()

}

}

At this point, I believe you have a deeper understanding of "how to install the configuration environment for Appium". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report