Skip to content

Latest commit

 

History

History
110 lines (84 loc) · 3.51 KB

File metadata and controls

110 lines (84 loc) · 3.51 KB

Mobile Automation with Appium and Cucumber in Java

Desired Capabilities for Appium (Androig/iOS)

  • Desired Capabilities are keys and values encoded in a JSON objecti sentby Appium clients to the server when a new automation session is requested
  • Desired Capabilities can be scripted in the WebDriver test or set within the Appium Server GUI (via an Inspector Session)

Get the Device ID

  • iOS From command line : $ xcrun simctl list

  • Android From command line : $ adb devices

adb

Appium Inspector in Appium Desktop

  • Appium Desktop offers an Inspector that you can use to look up or locate elements of an application.
  • It alsı lets you perform basic actions on these elements (such as tap and send keys)

appium_inspector

appium_inspector_win

Dependencies

  • Appium Java Client
        <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>7.0.0</version>
        </dependency>
  • TestNG
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.4.0</version>
            <scope>test</scope>
        </dependency>

Identifying UI Elements

Appium supports a subset of the WebDriver locator strategies such as:

  • find by "class"
  • find by "xpath" Appium additionally supports some of the Mobile JSON Wire Protocol locator strategies.

Android and iOS Locator Strategies

locator

Cucumber

  • Cucumber was created to drive Behavior Driven Development (BDD) process.
  • In Cucumber world, these files are called Feature files.
  • Once development is ready, the developers and(or QA will write Step Definitions.

Dependencies

  • Cucumber JUnit
        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>7.0.0</version>
            <scope>test</scope>
        </dependency>
  • Cucumber Java
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java8</artifactId>
            <version>7.0.0</version>
            <scope>test</scope>
        </dependency>
  • Gherkin
<!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
<dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>gherkin</artifactId>
    <version>23.0.1</version>
</dependency>

Requirements for Windows