免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Test Automation of Android App using Selenium WebDriver and Appium

Appium is an open-source tool for automating native, mobile web and hybrid applications on iOS and Android platforms. Appium is a server written in Node js. Through Appium you can test automatically your mobile application either on emulator or on real device.

Features:

  • Appium is “cross-platform”: It facilitates cross platform testing for both iOS and Android using the same API.
  • Appium is open source.
  • You don’t need source code of app to automate it.

How it works:

Appium server reads the command coming in from test Java code and executes that command on real device as well as on emulator.

Basic configurations before switching on app automation on a windows machine:

  1. At least Java 8 should be installed on your machine for running Appium server. Make sure environment variable and path are set properly.
  2. Microsoft .NET framework 4.5 should be installed on your machine.
  3. Download Android SDK and set the path in environment variable for ‘tools’ and ‘platform-tools’ folder.
    Note: Each version of android supports some API level. Appium supports above or equal API level 17 of Android.
  4. Developer mode should be ‘ ON’ on your device and inside developer mode ‘USB debugging’ option should be set to  ON .
    Note:
    · If Developer mode is not ON then you have to click 6 times on ‘About phone’ option in settings.
    · ‘RSA key accept’ popup must be come when above setting is on and you connect you device to PC. Please accept it.
    · I have faced a driver installation issue. If you face same issue then please install ‘PDANet’ software on your machine.
    · To verify your phone is connected properly, you have to open Eclipse IDE available with Android SDK and launch DDMS mode. If your device is appearing it means your phone is connected properly.
  5. Download & install Appium on your machine.

JAR files needed:

  1. Selenium server/Selenium Java client JAR file should be added in your project.
  2. Appium Java client should be added in your project.
  3. gson-2.2.4.jar file.

Below is the code for launching a mobile app and performing a login action on an Android app.

import java.io.File;import java.net.MalformedURLException;import java.net.URL;import java.util.concurrent.TimeUnit;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.remote.DesiredCapabilities;import io.appium.java_client.android.AndroidDriver;public class AndroidTest {	  static WebDriver driver;  public static void main(String arr[]) throws MalformedURLException, InterruptedException   {    File app= new File("apk-file-path");    DesiredCapabilities capabilities= new DesiredCapabilities();    capabilities.setCapability("deviceName", "your-device-name");    capabilities.setCapability("platformVersion", "platform-version");    capabilities.setCapability("platformName", "platform-name");    capabilities.setCapability("app", app.getAbsolutePath());    driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);    driver.findElement(By.id("username-element")).sendKeys("username");    driver.findElement(By.id("password-element")).sendKeys("password");    driver.findElement(By.id("password-element ")).click();    driver.quit();  }}

So let’s try to get an understanding of what we are trying to achieve in the above code snippet.

  1. We created a new Java project in Eclipse and added/build above mentioned JAR files in your project.
  2. Add the Android apk file path in our code.
  3. Set the above mentioned device capabilities.
  4. Initialize WebDriver instance with AndroidDriver as the path for Appium server through which they can connect to each other.
  5. Now find elements and perform action on those elements. You can find an element’s id by launching the uiautomationviewer tool available in Android SDK tools folder. You need to take a screenshot of the device and hover mouse on that particular element.
  6. Quit your driver.

Steps to execute automation script:

  1. Launch Appium server.
  2. Execute the above java code from Eclipse.
  3. Now it will start executing script on real device or on emulator.

With the proliferation of Mobile devices and innumerable mobile apps it is important for QA to stay ahead of the curve when it comes to automation. If you’re not already thinking of automating the testing of your mobile apps now is the time to do so before it gets too late. I’ll soon be sharing the write up on how to achieve the same for iOS applications.

You may also like

  • The lousy developer

    I’m not sure if there are any real metrics to judge the quality of software developers thus no one knows…

  • Our Software Engineer's Creed

    I would be a team player and would always put the success of my team first. I would take responsibility…

  • The rock star developer

    Not sure if the web needs another blog post on the rock star developer topic but I feel like writing…

  • The Good Developer

    There are various parameters to judge a developer but for me the number one criteria is efficiency. Ahem…I don’t mean…

本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
appium簡明教程
關于iOS的自動化測試
開始實際搭建App測試環(huán)境-Appium
移動測試 Appium源碼初探
【自動化測試】自動化測試框架與工具
用 Appium 自動收取螞蟻森林能量
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服