WebdriverIO — JAVA to JS Automation for Mobile Apps
By Padmini Aishwarya Bolgam- A Sitha “The Warrior” in her own Life!
In the initial days of my career, I used to hear my seniors saying WebdriverIO, Appium and many keywords then I started feeding my brain with some knowledge about the tools that we use for our Mobile App Automation. I’m gonna take you on the Journey of the iOS App Automation Architecture and some challenges faced to build the beautiful Framework.
There was a saying “Without a solid foundation you’ll have trouble creating anything of value”. So to create value for Beautiful Well Structured Automation we need to have a great and strong foundation i.e. Setup and Folder implementation. We have implemented Page Object Model(POM).
Pre-Requirements for setting up
For iOS Native apps, we need to use the .app file for the Simulator and the .ipa file on a Real device to run the app.
Firstly we need to install WebdriverIO
Then we need to setup the Configurations by running the below command
npx wdio config
Appium is an open-source, cross-platform test automation tool for native, hybrid, and mobile web apps, tested on simulators (iOS, FirefoxOS), emulators (Android), and real devices (iOS, Android, FirefoxOS).
Appium can be installed through the following command globally
npm install appium -g
As earlier said we have followed Page Object Model(POM), we have segregated the folders in the following ways
Config: This config is a specific config called shared.conf.js which is having all the default configurations for both the Apps(iOS & Android). This holds separate configuration files for both Android and iOS. These conf.js files have desired capabilities such as .app file path, version of the simulator, and name of the simulator.
Specs Files folder: This is having a folder called FrontEnd that contains files that have test cases for each page such as TS01.Onboarding.js which means <TestSuiteNumber>.<PageName>.js
Source: Source files contain the Test Data of each module.
Screen Activity: Each .js file contains methods that are used in each page/module.
Utils: Utils are the connectors that are used to fetch the data such as DB, Mails, API Connections, etc.
sendMail.js: This .js file contains the mail configurations on what needs to be sent in the mail.
MysqlDBConnection.js: This .js file has all the Database Connectivity methods through which we will be able to get the data from the Databases.
Wrappers: Wrappers are .js files with functions that are used for the overall App commonly.
Swipe.js: This .js file contains Swipe functions regardless of the screen Size.
appfunctions.js: This .js file contains app functions through which we use it in common for each page.
basefunctions.js: This .js file is a core and center of the project which interacts App with WebdriverIO Functions.
constants.js: Constants have the number of JSON Objects which have parameters with configurable values for running the test cases.
alertmessages.js: This file contains all the alert messages of each page that need to be validated according to the functionalities.
Runner: It has a wdioFunctions.js file. This file is a template for how the report has to generate in the mail.
Reporter: We are using allure as a reporter to create allure test reports.
The next step is to install the Appium Inspector. Appium Inspector serves the purpose of inspecting UI elements on mobile apps.
To use the Appium Inspector firstly we need to execute the command appium in the terminal, Then appium starts
Now open the appium inspector and enter the following values
We at CaratLane are solving some of the most intriguing challenges to make our mark in the relatively uncharted omnichannel jewellery industry. If you are interested in tackling such obstacles, feel free to drop your updated resume/CV to firstname.lastname@example.org