Skip to content

This repo demonstrates handling of pop-ups when using web testing with Appium on Cloud Grid

Notifications You must be signed in to change notification settings

hjsblogger/appium-ios-popup-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Handling Pop-ups in Appium Web Tests (on Cloud Grid)

appium-banner

Pre-requisites for test execution

This repo is a modified version of the official Appium TestNG repo. We have modified the repo for handling alerts (particulalry 'location preference alerts') that are triggered when web tests are triggered with Appium on the Safari browser.

location_preferrence

For demonstration, we are using Appium 2.x, Selenium 4.x, and TestNG v7.7.0. Follow the steps along for package installation & test execution:

Step 1

Create a virtual environment by triggering the virtualenv venv command on the terminal

virtualenv venv
VirtualEnvironment

Step 2

Navigate the newly created virtual environment by triggering the source venv/bin/activate command on the terminal

source venv/bin/activate

Step 3

Procure the LambdaTest User Name and Access Key by navigating to LambdaTest Account Page. You might need to create an an account on LambdaTest since it is used for running tests on the cloud Grid.

LambdaTestAccount

Set LambdaTest Username and Access Key in environment variables.

  • For Linux/macOS:
export LT_USERNAME="LT_USERNAME" 
export LT_ACCESS_KEY="LT_ACCESS_KEY"
  • For Windows:
set LT_USERNAME="LT_USERNAME" 
set LT_ACCESS_KEY="LT_ACCESS_KEY"

Step 4

Run the command mvn install (or mvn clean install) for installing the project dependencies (i.e. Appium, TestNG, SureFire plugin, etc.)

Steps for test execution

With this, all the dependencies and environment variables are set. Let's run the tests in serial and parallel modes.

Serial test execution

Trigger the command mvn test -P ios-single for running the Appium Java tests on iPhone 13 (v15).

Shown below is the terminal screenshot of the test execution:

ios-single-console

As seen below, the test execution was successful and the status is "Completed". You can find the status of test execution in the LambdaTest Automation Dashboard.

ios-single

Parallel test execution

Trigger the command mvn test -P ios-parallel for running the Appium Java tests on Safari browser installed on two different iPhone devices (located on LambdaTest cloud grid).

Shown below is the terminal screenshot of the test execution:

ios-parallel-console

As seen below, the test execution was successful and the status is "Completed". You can find the status of test execution in the LambdaTest Automation Dashboard.

ios-parallel

Have feedback or need assistance?

Feel free to fork the repo and contribute to make it better! Email to himanshu[dot]sheth[at]gmail[dot]com for any queries or ping me on the following social media sites:

LinkedIn: @hjsblogger
Twitter: @hjsblogger

About

This repo demonstrates handling of pop-ups when using web testing with Appium on Cloud Grid

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages