Giter Club home page Giter Club logo

appium-wait-plugin's Introduction

appium-wait-plugin npm version


AppiumWait2


This is an Appium plugin designed to wait for element to be present.

Prerequisite

Appium version 2.0

Tested with appium v2.0.0-beta.42

Installation - Server

Install the plugin using Appium's plugin CLI, either as a named plugin or via NPM:

appium plugin install --source=npm appium-wait-plugin

Installation - Client

No special action is needed to make things work on the client side.

Activation

The plugin will not be active unless turned on when invoking the Appium server:

appium --use-plugins=element-wait

Configuration

To override the default element-wait retry

  1. Use appium server CLI --plugin-element-wait-timeout=30000 --plugin-element-wait-interval-between-attempts=200

  2. Use appium server config file. Refer.

Example

Before wait-plugin

wait = new WebDriverWait(driver, 30);
wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("login"))).click();
wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("slider1")));
driver.findElementByAccessibilityId("slider1").click();
WebElement slider = wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("slider")));
WebElement slider1 = wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("slider1")));

After wait-plugin

driver.findElementByAccessibilityId("login").click();
driver.findElementByAccessibilityId("slider1").click();
driver.findElementByAccessibilityId("login").sendKeys('Hello');

Server logs will be as below:

[Appium] Plugins which can handle cmd 'findElement': element-wait (sessionless)
[Appium] Plugin element-wait (sessionless) is now handling cmd 'findElement'
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Element with accessibility id strategy for login selector found.
[Plugin [element-wait (sessionless)]] Checking if login element is displayed
[Plugin [element-wait (sessionless)]] login element is displayed.

appium-wait-plugin's People

Contributors

saikrishna321 avatar srinivasantarget avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.