Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
ONE TEST TO RULE THEM ALL
- CONQUER ANDROID AND
IOS WITH ONE SCRIPT
EYAL YOVEL, SOLUTION ARCHITECT QUALITEST GROUP
AUGUST ...
AUGUST 29, 2017
EYAL YOVEL, SOLUTION ARCHITECT QUALITEST
GROUP
ASAF SAAR, MOBILE PRODUCT MANAGEMENT
DIRECTOR, SAUCE LABS
MOBILE TESTING STRATEGY
Mobile App TestingWeb Testing
The industry’s only cloud-based testing platform for both
web and mobile applications that s...
MOBILE FIRST AT SCALE
By 2022, 70% of software interactions in
enterprises will occur on mobile devices.
Market	Guide	for	...
CURRENT MOBILE OFFERING
Manual Testing
Automated Testing
Emulators & Simulators
Public Cloud Private Cloud
Real Devices
Pu...
GARTNER SUPPORTS OUR APPROACH
A recommended approach is to find a
healthy mix of emulators, simulators and
real devices to...
COMPREHENSIVE MOBILE TESTING
Device Testing (on Wi-Fi
Networks + Networks
Simulation Tools)
● Recommended only for small s...
THE CHALLENGES FACED BY QA
THE CHALLENGES FACED BY QA
AUGUST 29, 2017 © Sauce Labs, Inc. 10
Appium	is	an	open	source	tool	for	
automating	native,	mob...
THE CHALLENGES FACED BY QA
AUGUST 29, 2017 © Sauce Labs, Inc. 11
THE CHALLENGES FACED BY QA
AUGUST 29, 2017 © Sauce Labs, Inc. 12
How	to	speed	up	writing	tests	using	the	
Serenity	BDD	Fra...
PAGE OBJECT MODEL
WHAT IS A PAGE OBJECT MODEL
AUGUST 29, 2017
• Modelling UI components as objects to be consumed by test code
• Representat...
WHY PAGE OBJECT MODEL
AUGUST 29, 2017
• Expose page and component services rather than mechanics
• Write concise tests tha...
AUGUST 29, 2017
• Tests are comprised of steps
• Steps interact with pages
• Pages provide services and key components
• O...
INTRODUCING
AUGUST 29, 2017
• Demonstrating the Page Object Model requires a testing framework
• Serenity is an open sourc...
ABOUT THE DEMO ENVIRONMENT
THE SYSTEM UNDER TEST
AUGUST 29, 2017 © Sauce Labs, Inc. 20
My giffgaff App – A UK mobile network
AUGUST 29, 2017
Introducing a basic Serenity test
Scenario: Log in to the giffgaff App
Given I am not logged in
When I log...
AUGUST 29, 2017
DEMO THE FRAMEWORK
© Sauce Labs, Inc. 22
CHALLENGES AND SOLUTIONS FOR
DEVELOPING A CROSS-PLATFORM
MOBILE TESTING SOLUTION
FIND ELEMENTS IN ANDROID AND IOS
AUGUST 29, 2017
IN MOST CASES WE WILL NOT BE ABLE TO FIND AN ELEMENT USING THE SAME IDENT...
FIND ELEMENTS IN ANDROID AND IOS
AUGUST 29, 2017
IN MOST CASES WE WILL NOT BE ABLE TO FIND AN ELEMENT USING THE SAME IDENT...
DIFFERENCES IN BEHAVIOR
AUGUST 29, 2017
DIFFERENCES IN BEHAVIOR BETWEEN THE PLATFORMS
FOR EXAMPLE: FIND THE MEMBER NAME:
©...
DIFFERENCES IN BEHAVIOR
AUGUST 29, 2017
DIFFERENCES IN BEHAVIOR BETWEEN THE PLATFORMS
FOR EXAMPLE: FIND THE MEMBER NAME:
©...
SOLUTION FOR FIND ELEMENTS
AUGUST 29, 2017
USE THE ANNOTATIONS @ANDROIDFINDBY AND @IOSFINDBY
© Sauce Labs, Inc. 28
SOLUTION FOR DIFFERENCES IN BEHAVIOR
AUGUST 29, 2017
WE WILL NEED DIFFERENT STEPS/CODE FOR THE DIFFERENT PLATFORMS FOR EXE...
AUGUST 29, 2017
DEMO RUN ON ANDROID PLATFORM
© Sauce Labs, Inc. 30
AUGUST 29, 2017
DEMO RUN ON IOS PLATFORM
© Sauce Labs, Inc. 31
LET’S DO THIS.
One Test To Rule Them All - Conquer Android and iOS With One Script
Upcoming SlideShare
Loading in …5
×

One Test To Rule Them All - Conquer Android and iOS With One Script

939 views

Published on

More and more companies deciding on mobile test automation are turning towards Appium. While it is very popular and its adoption is growing, it is not an easy task to implement a robust testing solution that is both cross platform and built to scale.

This webinar will explore how to build a mobile testing strategy based on Appium and BDD.

Join Asaf Saar, Sauce Labs Mobile Product Management Director, and Eyal Yovel, QualiTest Senior Test Consultant, as they discuss how a mobile testing strategy and the proper application of Page Object patterns can help leverage Appium’s power to produce concise, readable, and maintainable automated tests for both Android and iOS.

Here is what you will learn:
-How to define and implement a mobile testing strategy
-Challenges and solutions for developing a cross-platform mobile testing solution
-How to speed up writing tests using the Serenity BDD Framework and the Page Object Model

You will also see a live demo of a framework running Appium tests on iOS and Android.

Published in: Technology
  • Be the first to comment

One Test To Rule Them All - Conquer Android and iOS With One Script

  1. 1. ONE TEST TO RULE THEM ALL - CONQUER ANDROID AND IOS WITH ONE SCRIPT EYAL YOVEL, SOLUTION ARCHITECT QUALITEST GROUP AUGUST 29, 2017 ASAF SAAR, MOBILE PRODUCT MANAGEMENT DIRECTOR, SAUCE LABS
  2. 2. AUGUST 29, 2017 EYAL YOVEL, SOLUTION ARCHITECT QUALITEST GROUP ASAF SAAR, MOBILE PRODUCT MANAGEMENT DIRECTOR, SAUCE LABS
  3. 3. MOBILE TESTING STRATEGY
  4. 4. Mobile App TestingWeb Testing The industry’s only cloud-based testing platform for both web and mobile applications that spans desktops, simulators, emulators and real devices Desktops Emulators & Simulators Real Devices
  5. 5. MOBILE FIRST AT SCALE By 2022, 70% of software interactions in enterprises will occur on mobile devices. Market Guide for Mobile Application Testing Services Susanne Matson (June 2017)
  6. 6. CURRENT MOBILE OFFERING Manual Testing Automated Testing Emulators & Simulators Public Cloud Private Cloud Real Devices Public Cloud Mobile Testing SECURITY & PRIVACY
  7. 7. GARTNER SUPPORTS OUR APPROACH A recommended approach is to find a healthy mix of emulators, simulators and real devices to get the best out of your test automation. Market Guide for Mobile App Test Automation Tools Maritess Sobejana (April 2016)
  8. 8. COMPREHENSIVE MOBILE TESTING Device Testing (on Wi-Fi Networks + Networks Simulation Tools) ● Recommended only for small subset of network- dependent use cases ● Use for stable features ● Distribute features across device models and form factors ● Important for UX Testing ● Combine with WANem or similar tools for simulating network connectivity conditions ● High volume functional tests for large integration builds ● Frequent builds with high concurrency to reduce build times, enabling dev teams to not block each other Device Testing (in network) Device Testing (on Wi-Fi Networks + Networks Simulation Tools) Emulator & Simulator Testing EMULATORS, SIMULATORS & REAL DEVICES COVER ALL USE CASES
  9. 9. THE CHALLENGES FACED BY QA
  10. 10. THE CHALLENGES FACED BY QA AUGUST 29, 2017 © Sauce Labs, Inc. 10 Appium is an open source tool for automating native, mobile web and hybrid applications on iOS and Android platforms
  11. 11. THE CHALLENGES FACED BY QA AUGUST 29, 2017 © Sauce Labs, Inc. 11
  12. 12. THE CHALLENGES FACED BY QA AUGUST 29, 2017 © Sauce Labs, Inc. 12 How to speed up writing tests using the Serenity BDD Framework and the Page Object Model Challenges and solutions for developing a cross-platform mobile testing solution How to define and implement a mobile testing strategy
  13. 13. PAGE OBJECT MODEL
  14. 14. WHAT IS A PAGE OBJECT MODEL AUGUST 29, 2017 • Modelling UI components as objects to be consumed by test code • Representation of the services offered by a page • Abstracts test logic away from interaction with the WebDriver API and System-Under-Test © Sauce Labs, Inc. 14
  15. 15. WHY PAGE OBJECT MODEL AUGUST 29, 2017 • Expose page and component services rather than mechanics • Write concise tests that exercise functionality, not technical details • Create maintainable tests by isolating the effect of UI change on test code • Produce readable tests by keeping implementation details out of test code. © Sauce Labs, Inc. 15
  16. 16. AUGUST 29, 2017 • Tests are comprised of steps • Steps interact with pages • Pages provide services and key components • Operations on pages occur without any knowledge of page structure • Pages are comprised of elements • Each element represents a single item on a page that can be interacted with • Text, buttons, fields, images, etc. LAYERS OF ABSTRACTION © Sauce Labs, Inc. 16 Steps Page Objects Elements Tests
  17. 17. INTRODUCING AUGUST 29, 2017 • Demonstrating the Page Object Model requires a testing framework • Serenity is an open source Java (and recently JavaScript) library to speed up writing tests; including: • Complete WebDriver testing framework • Parallel execution of tests using JUnit, Cucumber or JBehave • Integration with Sauce Labs, Appium, JIRA, and other testing tools • Detailed reporting • Well used across the industry. © Sauce Labs, Inc. 18
  18. 18. ABOUT THE DEMO ENVIRONMENT
  19. 19. THE SYSTEM UNDER TEST AUGUST 29, 2017 © Sauce Labs, Inc. 20 My giffgaff App – A UK mobile network
  20. 20. AUGUST 29, 2017 Introducing a basic Serenity test Scenario: Log in to the giffgaff App Given I am not logged in When I log in as ‘eyalyovel’ Then I am logged in as ‘eyalyovel’ Framework: • Serenity, Appium, BDD (feature file) and Maven • Execute on local Samsung galaxy S6 device and on iPhone 7 simulator located on the Sauce Labs cloud • Hard-coded test data LOGIN TEST © Sauce Labs, Inc. 21 Steps LoginSteps Page Objects LoginPage MygiffgaffAccountPag e Elements usernameField passwordField loginButton Test Login.feature
  21. 21. AUGUST 29, 2017 DEMO THE FRAMEWORK © Sauce Labs, Inc. 22
  22. 22. CHALLENGES AND SOLUTIONS FOR DEVELOPING A CROSS-PLATFORM MOBILE TESTING SOLUTION
  23. 23. FIND ELEMENTS IN ANDROID AND IOS AUGUST 29, 2017 IN MOST CASES WE WILL NOT BE ABLE TO FIND AN ELEMENT USING THE SAME IDENTIFIER IN ANDROID AND IOS © Sauce Labs, Inc. 24
  24. 24. FIND ELEMENTS IN ANDROID AND IOS AUGUST 29, 2017 IN MOST CASES WE WILL NOT BE ABLE TO FIND AN ELEMENT USING THE SAME IDENTIFIER IN ANDROID AND IOS © Sauce Labs, Inc. 25
  25. 25. DIFFERENCES IN BEHAVIOR AUGUST 29, 2017 DIFFERENCES IN BEHAVIOR BETWEEN THE PLATFORMS FOR EXAMPLE: FIND THE MEMBER NAME: © Sauce Labs, Inc. 26
  26. 26. DIFFERENCES IN BEHAVIOR AUGUST 29, 2017 DIFFERENCES IN BEHAVIOR BETWEEN THE PLATFORMS FOR EXAMPLE: FIND THE MEMBER NAME: © Sauce Labs, Inc. 27
  27. 27. SOLUTION FOR FIND ELEMENTS AUGUST 29, 2017 USE THE ANNOTATIONS @ANDROIDFINDBY AND @IOSFINDBY © Sauce Labs, Inc. 28
  28. 28. SOLUTION FOR DIFFERENCES IN BEHAVIOR AUGUST 29, 2017 WE WILL NEED DIFFERENT STEPS/CODE FOR THE DIFFERENT PLATFORMS FOR EXECUTING THE SAME SCENARIO. © Sauce Labs, Inc. 29 • We can have different page object files for the Android and the iOS pages • Before running the tests, find what is the platform and run the code according to that
  29. 29. AUGUST 29, 2017 DEMO RUN ON ANDROID PLATFORM © Sauce Labs, Inc. 30
  30. 30. AUGUST 29, 2017 DEMO RUN ON IOS PLATFORM © Sauce Labs, Inc. 31
  31. 31. LET’S DO THIS.

×