Vous êtes sur la page 1sur 11

Appium Configuration Steps:

Softwares needed: Java JDK full package, Android SDK and AVD Manger from
Android Studio, Appium Server, Visual Studio 2012, Nuget, Appium dot net drivers,
json, nunit, web driver and web driver support jars
1. Download java JDK

2. Download Android SDK

3.Download Appium

4. Install Visual Studio 2012


Steps:
Step 1.Install Java and configure java path in environment variables

Step 2: Install Android SDK and Configure SDK, tools and plat form_tools path in
environment variables,
ANDROID_HOME: C:\Users\SAnkireddygari\AppData\Local\Android\sdk,
C:\ProgramData\Oracle\Java\javapath;C:\Users\SAnkireddygari\AppData\Local\Androi
d\sdk\tools;C:\Users\SAnkireddygari\AppData\Local\Android\sdk\platformtools;C:\Users\SAnkireddygari\AppData\Local\Android\sdk\platforms;

Step 3: Check once environment variables configured properly or not from cmd
prompt
(By executing java, javac, java version, javac version, adb commands)
Step 4: Run SDK Manager
Navigate to SDK Manger location
C:\Users\SAnkireddygari\AppData\Local\Android\sdk

Step 5: Install required packages according to the which API Level we need

Step 6: Run AVD Manager

Step 7: Create AVD by giving AVD Name, Device, Target API Level and other
mandatory fields create AVD

Step 8: Start AVD

Step 9: By default AVD will launch on 5554 port (After click on start button it will
took little bit more time to open emulator home screen)

Step 10: Install Appium Server


Step 11: Start Appium Server

Step 12: Check default server address and pass the same address in script

Step 13: Create new project in visual studio 2012 and add all the Appium and web
driver references from NuGet

Step 14: Create new Unit test and add the below code from that test
using
using
using
using
using
using

System;
Microsoft.VisualStudio.TestTools.UnitTesting;
OpenQA.Selenium.Remote;
OpenQA.Selenium;
OpenQA.Selenium.Appium;
OpenQA.Selenium.Appium.Android;

namespace Appium
{
[TestClass]
public class AppiumTest

public IWebDriver driver;


[TestMethod]
public void LaunchBrowser()
{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.SetCapability("device", "Android");
capabilities.SetCapability(CapabilityType.BrowserName, "Chrome");
// capabilities.SetCapability("app-package", "com.android.browser");
//capabilities.SetCapability("app-activity", "com.android.browser.BrowserActivity");
//capabilities.SetCapability("app", "browser");
capabilities.SetCapability("deviceName", "Galaxy Nexus");
capabilities.SetCapability("platformName", "Android");
capabilities.SetCapability("platformVersion", "4.2.2");
capabilities.SetCapability("device ID", "emulator-5554");
AppiumDriver<IWebElement> driver;
driver = new AndroidDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"),
capabilities);
driver.Navigate().GoToUrl("http://www.dsstage.drugstore.com/");
driver.Quit();
}

Step 15: Start Appium Server

Step 16: Download chrome apk from google and install chrome browser in
emulator
Step 17: Check once chrome browser installed successfully or not in opened
emulator

Step 18: Run Appium test program from visual studio

Step 19:Observe Appium server logs and 5554 emulator


Step 20: Itll automatically opens the chrome browser

Issues:
1. If unlock app will not installed in emulator means sometimes it will not unlock
automatically
2. I am able to launch installed chrome browser from emulator but there is an
issue with installed chrome version for that particular api level emulator I am trying

to resolve this by using different combinations for chrome versions and api levels
emulators.

Vous aimerez peut-être aussi