banner



How To Setup Appium On Windows

Appium:-

  • Appium is an open source, cross-platform mobile application testing tool.
  • Support Json
  • Support automation exam on physical device also as Similar or emulator both.
  • It no dependency on mobile device.

Appium installation on windows OS:-

Before appium installations download the following

  1. JAVA IDE (Eclipse)
  2. Java JDK (1.8 or higher version) installation from here https://www.oracle.com/java/technologies/javase-downloads.html
  3. Android Studio (To Connect device)
  4. Selenium Server jars
  5. Appium jars
  6. npm & node.exe
  7. TestNG for Eclipse
  8. ADT plugin (it used to access android SDK inside eclipse)
  9. Set up SDK path in windows

Supported Devices:-

  1. Android four.4 and Above.
  2. IOS 9 and Above

Ready JDK Path in Windows

1) Note downward the path where JDK is installed in your arrangement.

two) Copy the path till bin binder considering that is where the java application is establish.

3) Open up Control Panel>> System >>Avant-garde Arrangement Settings>> Environmental Variables>> Click New.

iv) click on OK, variable reverberate in the list of ecology variable set.

5) Make certain that the organisation can accept the Java that is installed, become to the CMD and blazon 'java –version'.

Should result version of the JDK installed in the arrangement.

Install Android SDK (Software Development Kit)

i) Download Android SDK from https://developer.android.com/studio

two) Clicks on the link "android-sdk_r24.iv.1-windows.nil" (or which is the latest you find at that place) and then click on "Download" button.

iii) aught file gets downloaded, unzip the folder.

Set Environment Variable for android SDK:-

1) Note down the path of Android SDK is installed.

2) Click on Environment Variables >>Create a new user variable ANDROID_HOME>> and set the Android SDK path.

3)Set 2 paths in the system variable Path:

  • Path of the "platform-tools" folder in the Android SDK bundle ( For Example,  C:\User Files\Appium Automation\Android\android-sdk\platform-tools).
  • Path of the "tools" folder in the Android SDK bundle ( For Example,  C:\User Files\Appium Automation\Android\android-sdk\tools).

Install Appium

1) Open the Appium http://appium.io/

2) Click on the "Download" link.

three) Select the Os of the automobile that you are working on and download the appropriate version.

four) Unzip the downloaded zip folder.

5) Install the .exe file "appium-installer".

half dozen) Specify the path for installation.

Install Node.js

Node.js comes with Appium. But in some cases, it doesn't work. And then on the safer side, install it separately.

  1. Visit this https://nodejs.org/en/download/
  2. Click on the Windows Installer tab.
  3. Download Starts.
  4. Install it.

Selenium Jar Files

This is required for the interaction between test scripts and Selenium WebDriver.

ane) Go to the https://www.selenium.dev/downloads/ link.

2) Click on the Download link JAR available (selenium server standalone and java customer library jar files).

3) Extract the downloaded nil folder.

Add together the Libraries to the Project

1) Open Eclipse IDE.

2) Create a new Java Project>>Create a new package under this project>> Create a new class under this package.

3) Correct-click on your Projection name>> Select Build Path>> Select Configure Build Path.

4) Click on the "Add together External JARs" push button>>get to the path where you accept saved the Selenium WebDriver zip folder.

5) Select both the .jar files.

six) Now select all the .jar files within the libs folder.

7) Jar files are added as a part of the project dependencies every bit shown below.

viii) Jar files are added as a function of the project dependencies every bit shown beneath.

Appium Client Libraries

Nosotros crave language-detail client drivers. Every bit nosotros will be working on Java, we volition require the Java client drivers.

1) Get to the http://appium.io/downloads.html link.

2) Click on the Java link nether the "Appium Client Libraries" department.

3) Click on the JAR link.

4) Download Get-go.

Configure Library file (all dependencies) with Project:

  1. Right click on Project name>>Select Build Path>>Select Configure Build Path.
  2. Click on the "Add External JARs" push button>> go to the path where you take saved the Coffee Client jar file.
  3. At present select the jar file and add it.
  4. Jar file added like a part of the project dependencies  shown below.

Configuring Mobile Device with System in Appium

Explains how to connect  Mobile Device with PC and configure  for Automation Testing Using Appium. And Verification of Mobile by ADB :

  • USB Debugging fashion is enabled on  mobile device.
  • ADB acknowledge the device continued to the system.
  • Irresolute theDesired capability equally per the device/awarding

Enable USB Debugging Mode in Mobile Device

ane) Programmer Options

  1. Open up to the "Settings" app on the phone.
  2. Scroll down and click on Programmer Options.
  3. Turn on the "Programmer Options" and click the "USB Debugging".

Some devices not have "Developer Options" in Settings. In this cases, follow the following steps:

  1. Navigate to Settings > About Phone > Build Number.
  2. Tab on Build number 7 times, and so a pop up will appear saying "You are now a developer".
  3. Go dorsum to settings. Yous volition notice "Developer Options" getting listed.
  4. Enable "USB Debugging" and now the device is ready to connect to the organization
  5. Afterward washed, you will now be able to enable/disable information technology whenever y'all want by going to Settings>> Developer Options >>Debugging >> USB debugging.

Verify If System Recognizes a Device Using ADB

To verify if the organization is able to recognize the device,

  • Open command prompt
  • Type >>"adb devices"
  • Click on "Enter".

Desired Capabilities

Desired Capabilities is a JSON object sent past the client libraries to Appium server.

Desired Capabilities is a form in Selenium and is used to store properties of applications and devices.

Properties are read by Appium at run fourth dimension and recognize the device and awarding for automation. Need to import "import org.openqa.Selenium.remote. DesiredCapabilities" library file and add to the project in order to piece of work with the Desired Capabilities.

In guild to ensure automation on the mobile device connected.

Major capabilities used for Automation are:-

Adequacy  Explanation
platformName In this nosotros can pass value "Android", "IOS", FirefoxOS:
caps.setCapability("platformName","Android");
platformVersion Set the mobile Os Version like caps.setCapability("platformVersion","5.6″);
deviceName Enter device name or emulator to utilise caps.setCapability("deviceName", "Redmi9'");
appPackage Java package of android app to run example com.android.settings for setting app
appActivity Enter particular app activity MainActivity
browserName Enter Name of Browser if y'all want run mobile spider web automation caps.setCapability("browserName", " Chrome");

Steps To Automate a Native App

1) Connect the Mobile Device Or Create an Emulator

Connect mobile device using a USB cablevision or create virtual device in the system.

ii) Get Details of App to exist launched

Install the app in the device emulator.

In that location are two ways to install the application

  • From play store: Install directly from the PlayStore.
  • Use apk file: An 'apk' file from which it is installed. Can directly install the awarding in the device using the apk file.

iii) Start Appium Server

Open CMD and Enter # appium

4) Appium Examination Script

configuration to start Appium.

Desired Capabilities, Backdrop of Device, Awarding, and Browser are defined.

5) Interact With Elements Using UIAutomator Viewer

Inspect elements, nosotros have a tool called UIAutomatorViewer in the Android SDK package.  Tool provided past Android SDK that lets yous audit elements in your mobile app.

UIAutomatorViewer comes with an Android SDK packet. There are 2 ways in which you can open UIAutomatorViewer.

Open UIAutomator Viewer From Andoird SDK Bundle:

To open redirect to the location where Android SDK is installed. In my case the path of UIAutomatorViewer "C:\Users\user\AppData\Local\Android\Sdk\tools\bin"

In one case the batch file is run, the tool gets opened.

Open UIAutomator Viewer From Command Prompt:

  • Go to the command prompt.
  • Type >>uiautomatorviewer and hit Enter.

How to inspect Mobile Elements using UI Automator Viewer:

  • The mobile is connected to the arrangement.
  • Open the app on mobile device.
  • Inspect elements on the active mobile screen, click on Icon in the UIAutomatorViewer tool on the pinnacle left, to capture screenshot of the active screen on the device.
  • Icon on the left takes a screenshot of the screen currently open on the mobile device and its properties are which each element can be identified.

You will observe the screenshot of the mobile device in the left pane, and the right pane volition agree the node construction and properties of each Node.

When you hover on element in screenshot, its attributes listed in the right panel with its value.

Element can exist identified using Id, ClassName, Xpath, etc.

half-dozen) Run the Script and automate the app

  • Run script as a Coffee application or from TestNG.
  • After execute, the Appium files logs for all actions performed confronting the mobile device.

The log holds details as:

  1. Appium session was established.
  2. Device details, Application details are recognized and the connection is made.
  3. Deportment in the script are executed and issue to client for success bulletin.

Comments

Source: https://www.aurigait.com/blog/how-to-install-appium-in-windows-os-and-write-first-test-script/

Posted by: brittainseatomint.blogspot.com

Related Posts

0 Response to "How To Setup Appium On Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel