Top Banner
Mobile Test Automation Framework Shankar Garg Senior Consultant - Testing
24

Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

Jun 10, 2018

Download

Documents

phungthuan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

Mobile Test Automation Framework

Shankar GargSenior Consultant - Testing

Page 2: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

• Problem Statement

• Features of Test Automation Framework

• Tech stack and why

• Demo

• Did we still miss something

• Page Objects

3/10/14

Page 3: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Why Mobile

Page 4: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

• Back in the day, one bad customer experience would spread via word-of-mouth and reach few Customers.

• Thanks to Social Media platforms like Twitter , Facebook etc. however, that same word-of-mouth now travels at the speed of light and reaches million users.

• The other major difference is App Store ratings. Imagine if a poor review were stamped directly on the packing of a product.

• These Social Media Ratings and Likes can prove to be a make or break for the brand and product.

3/10/14

Why Quality is important

Page 5: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Challenges for Testing Teams

• Mobile Test Teams have to repeat the entire test cycle for each of the following:

• Multiple OS – Android and iOS

• Multiple Hardware – Samsung, Apple etc

Page 6: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Challenges for Mobile Test Teams

• Lot of Regression Testing.

• Frequent application releases:

• Ease of upgrading apps over the air

• Increased user expectations about quicker releases (for bug fixes and new features)

• OS updates.

• Test teams are continuously tasked with testing entire applications faster and more often.

Page 7: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

Test Automation - Appium

3/10/14

• Appium has made life easy for Mobile Automation Teams.

• Appium has enabled test teams to use the same code to test on

• Multiple OS

• Multiple hardware

Page 8: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Challenges for Automation Teams

• Although Appium Solved lot of Mobile Specific problems but problems specific to Framework design still remain.

• Maintainability

• Reusability

Page 9: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

What about Agile Testing ?• With the advent of Agile practices,

Behavior Driven Development/Testing has also gained more popularity.

Page 10: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Mobile Test Automation Framework -Features• Non Technical people can help in Test Automation.

• Requirements are directly converted into Test cases ( to eliminate difference in understanding of Dev and QA)

• Supports multiple OS i.e. iOS, Android etc. ( Same tool can be used to write test case for iOS and Android)

• Inter portability of same test cases on Multiple platform ( Same test case can be run for iOS and Android).

• Maintainability ( How easy it is to change/update a test case)

• Re-usability ( How easy it is to use existing code to write new test cases)

Page 11: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

What’s the Solution:• No tool alone can solve the problem mentioned

above.

• Appium alone cannot solve these challenges

• Frequent UI/functionality updates.

• Implementing behavior driven development &

• What is needed is, the combination of tools which can address these problems when combined together.

Page 12: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Tech Stack

• Java• Maven• Appium• Cucumber• Git• Jenkins

Page 13: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Why Cucumber?• Cucumber Enables Non Technical team members to help

in Test Automation (by writing feature files).

• Cucumber can be implemented in multiple languages. i.e. Java, Ruby and JavaScript.

• Cucumber can be used to implement projects in wide business areas like enterprise web, Mobile, Web Services.

• Cucumber is very easy to install, implement and learn.

Page 14: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Why Appium?• Support for multiple platforms iOS, Android and Firefox

OS.

• Support for Native, Web and Hybrid Applications.

• Can be implemented in multiple languages Java, PHP, Python, Ruby, C# etc.

• No Additional Library added to AUT.

• Can be implemented with any Testing Framework i.e. Junit, TestNG, Cucumber etc.

Page 15: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Demo• Application Under Test

• Project Strucutre

• Feature File

• Glue Code

• Hooks

• DriverFactory.java

• Appium Code

Page 16: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

What we have achieved• Non Technical people can help in Test Automation.

• Requirements are directly converted into Test cases ( to eliminate difference in understanding of Dev and QA)

• Supports multiple OS i.e. iOS, Android etc. ( Same tool can be used to write test case for iOS and Android)

• Inter portability of same test cases on Multiple platform ( Same test case can be run for iOS and Android).

• Maintainability ( How easy it is to change/update a test case)

• Re-usability ( How easy it is to use existing code to write new test cases)

Page 17: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Is there a problem still?• Locators:

• are spread across file and if some one needs to change a locator then he will have to make changes at multiple places.

• we face a risk of some locators not being updated at all.

• To know at what all places the particular locator was defined is the biggest challenge.

• Scope :There is no scope defined for a file, it may contain function for entire application or for some part only. if a new team member joins, then he will face hard time finding a function already defined.

Page 18: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Page Objects:• Framework design approach for maintaining &

accessing components & controls spread across test scenarios.

• Page Object creates a DSL for our tests.

• if something changes on the page we don't need to change the test, we just need to update the object that represents the page.

Page 19: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Page Objects - Guidelines

• Each Page object scope will be limited to one page of the application only.

• All locators related to that page will be defined in the page object ( all locators will be grouped at one place, possibly on the Top so that it is easy to find and update these).

• All behaviors associated to a page will be described in the page object as functions.

Page 20: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

Page Objects –Benefits

3/10/14

• The beauty of these files is that just by looking at the code, you can relate for which part of the application these files belong to.

• How easy it becomes to change and at the same time how easy it is to add new functionality.

Page 21: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

What we have achieved• Non Technical people can help in Test Automation.

• Requirements are directly converted into Test cases ( to eliminate difference in understanding of Dev and QA)

• Supports multiple OS i.e. iOS, Android etc. ( Same tool can be used to write test case for iOS and Android)

• Inter portability of same test cases on Multiple platform ( Same test case can be run for iOS and Android).

• Maintainability ( How easy it is to change/update a test case)

• Re-usability ( How easy it is to use existing code to write new test cases)

Page 22: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile

3/10/14

Limitations?

• To do

Page 24: Mobile Test Automation Framework - DeveloperMarch · Automation Teams. •Appium has enabled test teams to use the same code to test on •Multiple OS •Multiple hardware. ... Mobile