Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03...

56
Secret Ingredient for Automation Success – Page Object Model (POM) #TestExpo

Transcript of Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03...

Page 1: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

Secret Ingredient for Automation Success –Page Object Model (POM)

#TestExpo

Page 2: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

Matthew Manickakumar

About me

Senior Automation Test Engineer.

Over 13 years of working experience in Test automation.

Extremely passionate about Test Automation and technical troubleshooting.

Worked with many tools Test Automation tools eg: Winrunner, QTP, UFT, Rational Robot, RFT, Selenium, Testcomplete, Xamarin UI, Appium etc.

Certified by HP, IBM, ISTQB, TMap.

01 Secret Ingredient for Automation Success – Page Object Model (POM)

Page 3: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

3© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Agenda

01 Introduction02 Test Automation03 Tools & Frameworks04 Challenges from QualityReport05 Scope06 Working mechanism

07 What is Page Object08 Pattern 01 – Case Study09 Pattern 02 – Case Study10 Exercise11 Pattern 03 – Case Study12 Tips

Questions

TODO

Page 4: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

4© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

01 Introduction

Page 5: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

5© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

02 What is Test Automation?5

It’s a process to increase your test productivity using a robotic companion.

P.S :Behind every successful test automation there is great tester!

Page 6: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

6© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Where does firms want test automation to be implemented ?

6

Regression Testing

User Acceptance / Pre production Test

Integration Testing

Smartphone

Surface Technology

Web services

Cloud

Cross Browsers

E2E Business Flows

IoT

Apps

RealTime Operating System

Smart Watch

Smart SpeakersSmart Home Appliance

DevOps

Page 7: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

7© Capgemini 2019. All rights reserved |Presentation Title | Author | Date7

03 Test and Automation Tools

LeanFT

Page 8: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

8© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

29 May 20198

GUI Rich front end

Page 9: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

9© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Test Data

Test Scripts

Reusable Functions

BehaviorDriven

Behavior

Evolution of Test Automation framework

Record & Play

Stand Alone Test Script

Modular

Reusable Functions

Data Driven

Reusable Functions

Test Scripts

Test Data

Test Script

KeywordDriven

Reusable Functions

Test Scripts

Test Data

Keywords

BusinessDriven

Reusable Functions

Test Scripts

Test Data

Keywords

Business Flow

Generations

Feat

ures

Page 10: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

10© Capgemini 2019. All rights reserved |Presentation Title | Author | Date 10Copyright © Capgemini, Sogeti and Micro Focus 2018. All Rights Reserved.

04 Quality@Speed is a core challenge for application development

Lack of end to end automation from build to deployment

Too slow testing process

Lack of proper skills for QA & Testing

55%

43%

42%

Top 3 bottlenecks in AD Top 3 challenges with testing digital solutions

Page 11: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

11© Capgemini 2019. All rights reserved |Presentation Title | Author | Date 11Copyright © Capgemini, Sogeti and Micro Focus 2018. All Rights Reserved.

Test Automation levels are too low to speed up

Levels of test automation Test automation challenges

Page 12: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

12© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

29 May 201912

Published on : 28-06-1999

Page 13: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

13© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

05 Scope for Discussion

Non-GUI Test

Web /Browser

Mobile Native

Hybrid

ios

Android

IEEdge Firefox

Chrome Edge

Windows Linux

REST Database Messaging Queues

Mac

Automation Tool

PlayStation Xboxe-sports

GUI Test

Page 14: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

14© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

06 Working Mechanism

Page 15: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

15© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

06 Working Mechanism

Page 16: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

16© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

06 Working Mechanism

Page 17: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

17© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

06 Working Mechanism

Page 18: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

18© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

06 Working Mechanism

Object Identifier

• ID• Name• Class Name• Tag Name• Link Text• Partial Link Text• XPATH• CSS properties

document. getElementById(‘login’)

document. getElementByName(‘login’)

document. getElementByClassName(‘login’)

document. getElementByTagName(‘login’)

Page 19: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

19© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

06 Working Mechanism

Automation ToolTest Script Application Under Test

ObjectIdentifier JQuery

objObject Validation

driver.findElement(By.name("uid")) document.getElementById(‘login’)

Obj.getText()

Page 20: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

20© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Automation ToolTest Script Application Under Test

ObjectIdentifier JQuery

objObject Validation

driver.findElement(By.name("uid")) document.getElementById(‘login’)

Obj.getText()

06 Working Mechanism

Page 21: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

21© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Automation ToolTest Script Application Under Test

ObjectIdentifier JQuery

objObject Validation

driver.findElement(By.name("uid")) document.getElementById(‘login’)

Obj.getText()

Automation ToolTest Script Application Under Test

ObjectIdentifier.action() Jquery.action()

*action = click (), select(), set()... etc

06 Working Mechanism

Page 22: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

22© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Automation ToolTest Script Application Under Test

Script

Data

Library

Page Object

06 Working Mechanism

Page 23: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

23© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Page Object

Page 24: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

24© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

07 Page Objects

What is page objects pattern

The goal behind page objects is to abstract any page information away from the actual tests

A page object is an object-oriented class that serves as an interface to a page in the application under test

Page 25: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

25© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

07 Page Object Patterns

Why is it significant

Learning a pattern up front can prevent you from making a design mistake, but as in most situations, making a mistake is your very best opportunity to learn

Page Object simply models objects within the test code. This reduces the amount of duplicated code and means that if the UI changes, the fix need only be applied in one place

Page 26: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

26© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

08 Page Object Patterns

Case :

1. FrontEnd : Basic Html5

2. Environments: Web browser – Chrome

3. Complexity of application under test : Simple

Requirement :

Pilot task ( testing the water)

Team : Beginner to test automation

Pattern 1

Page 27: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

27© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

08 Page Object Patterns

Naivepublic class NoPOM{

Webdriver driver;

@BeforeTestpublic void before(){driver = new FirefoxDriver();driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);}

@Testpublic void test_Home(){driver.get("http://demo.login.com");driver.findElement(By.name("uid")).sendkeys("demo");driver.findElement(By.name("password")).sendkeys("*****");driver.findElement(By.name("bLogin")).click();String HjemHeader = driver

.findElement(By.Xpath("//table//tr[@id='heading']"))

.getText();asserthat(HjemHeader,"hjem");}

}

Page 28: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

28© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

08 Page Object Patterns

Pattern 1

Test Data

Test Script

Test Conditions

Library

Test object

assertions

Page 29: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

29© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

08 Page Object Patterns

Pros & Cons

• Easy to build• Quick turn around• Requires limited knowledge

• Less reusablity• Duplication of code• Maintance effort is directly propotional to

the design effort

Page 30: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

30© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Case :

1. FrontEnd : Html5

2. Database : max 50GB (production)

3. Environments: Web browsers (Chrome / Firefox / Edge)

4. Complexity of application under test : Small business

Requirement :

Over 25-40% of test being automated

Team : Advance test automation users

Pattern 2

Page 31: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

31© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Pattern 2 – Level 1<hjem.html>

<Søg.html>

<SignUp.html>

hjem.class

Sog.class

SignUp.class

Test Script

• Object identifier• methods

driver.findElement(By.name("uid")).sendkeys("demo");

Page 32: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

32© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Pattern 2 – Level 2

<hjem.html>

<Søg.html>

<SignUp.html>

hjem.class

Sog.class

SignUp.class

Test Script

PageBase.class

header

footer

home

header

footer

search

menu

header

footer

menu

signUp

header footermenu

Test Base

Page 33: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

33© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Pattern 2

public class TestBase {protected static WebDriver driver;

@BeforeClasspublic static void setUp(){

driver = new FirefoxDriver();driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

}

@Afterpublic void cleanUp(){

driver.manage().deleteAllCookies();}

@AfterClasspublic static void tearDown(){

driver.close();}

}

hjem.class

Sog.class

SignUp.class

Test Script

Test Base

Page 34: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

34© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Pattern 2

public class SignUpPage extends PageBase {

@FindBy(id="firstname")private WebElement firstName;

@FindBy(name="lastname")private WebElement lastName;

@FindBy(xpath=”//input[@name='address']")private WebElement address;

@FindBy(id="zipcode")private WebElement zipCode;

@FindBy(id="signup")private WebElement submitButton;

public SignUpPage (WebDriver driver) {super(driver,”Signup”);

}

public void enterName(String firstName, String lastName){

this.firstName.clear();this.firstName.sendKeys(firstName);

this.lastName.clear();this.lastName.sendKeys(lastName);

}

public void enterAddress(String address, String zipCode){

this.address.clear();this.address.sendKeys(address);

this.zipCode.clear();this.zipCode.sendKeys(zipCode);

}

public HjemPage submit(){submitButton.click();return new HjemPage(driver);

}}

hjem.class

Sog.class

SignUp.class

Test Script

Test Base

• Object identifier• methods

Page 35: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

35© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

PageBase

public class PageBase {protected WebDriver driver;protected String pageName;

public PageBase(WebDriver driver, string page){this.driver = driver;this.pageName = page;

}

public static Header header(){ return new Header(driver);

}public static Footer footer(){

return new Footer(driver);}

public static Menu menu(){return new Menu(driver);

}public static boolean isInitialized(){

return (pageName.contains(header.name))? true:false;}

}

hjem.class

Sog.class

SignUp.class

Test Script

PageBase.class

header footermenu

Test Base

Page 36: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

36© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Pattern 2

hjem.class

Sog.class

SignUp.class

Test Script

PageBase.class

header footermenu

Test Base

Page 37: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

37© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Pattern 2

public class SignUpFormTest extends TestBase {

@Testpublic void signUp(){

driver.get("http://www.123.html");

SignUpPage signUpPage = new SignUpPage(driver);assertTrue(signUpPage.isInitialized());

signUpPage.firstName.set(”frank”); signUpPage.lastName.set(”Jackson");signUpPage.enterAddress("123 Street", "12345");

HjemPage hjemPage = signUpPage.submit();assertTrue(hjemPage.isInitialized());

assertEquals("Thank you", hjemPage.confirmationHeader());}

}

Transition step

Page Object

TestBase

Page 38: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

38© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

09 Page Object Patterns

Pros & Cons

• Increased reusablity• Maintainable• structured development cycle

• Planning required• Senior mentorship required during test

design• Support to custom technology is not out

of box

Page 39: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

39© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

10 Exercise

Situation 1

Label change from ‘Kategori’ to ‘Type’Id property of this object will change from ‘kategoryselect’ to ‘typeselect’

Page 40: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

40© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

10 Exercise

Situation 2

New feature included :1. When focus is brought to [Menu], ribbon opens and object are displayed.2. New section ‘Om BilBasen’ included.3. Menu is visible across all pages.

Page 41: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

41© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

10 Exercise

Situation 3

New feature included :1. Old dropdown replaced with new

custom object ‘maskeddropdown’. 2. Places marked in red will receive

update in next build.3. To set value to this object use Custom

operation $(#id).data(maskeddropdown).set()

SearchPage

Advance SearchPage

Page 42: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

42© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

11 Page Object Patterns

Case :1. FrontEnd : Html5, third party plugins & Custom plugins2. Database : minimum expected 3 TB data (production)3. Environments: Web browsers, mobile4. Complexity of application under test : Enterprise

Requirement :Over 50-70% of test being automated

Team : Advance test automation users

Pattern 3

Page 43: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

43© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

29 May 201943

11 Page Object Patterns

Pattern 3

Page 44: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

44© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

User

CPR

First Name

Search

User

User: PageBase

Webelement CPR

Webelement FirstName

Webelement Ok

PageBasePageBase : IWebDriver

- Isloaded()- Get Alert()- Toast Container()- Toast Manage List ()

Page Class

Custom methods()*

* Collection of all methods which could be reused within this page.

Pattern 311 Page Object Patterns

@FindBy(id="firstname")private WebElement firstName;

Page 45: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

45© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

User

CPR

First Name

Search

User

User: PageBase

TextBox CPR

TextBox FirstName

Button Ok

PageBasePageBase : IWebDriver

- Isloaded()- Get Alert()- Toast Container()- Toast Manage List ()

Page Class

Custom methods()*

* Collection of all methods which could be reused within this page.

Pattern 311 Page Object Patterns

Page 46: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

46© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

User

CPR

First Name

Search

User

User: PageBase

TextBox CPR

TextBox FirstName

Button Ok

PageBasePageBase : IWebDriver

- Isloaded()- Get Alert()- Toast Container()- Toast Manage List ()

Control Class

Control

- Text()- Grid ()- Image()- Accordion()- Span()- Button()- Link()- Table ()

ControlBase- Enabled()- Clickable()- Type()- Click()- Select()

Page Class

Custom methods()*

* Collection of all methods which could be reused within this page.

11 Page Object PatternsPattern 3

:ControlBase

Page 47: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

47© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

11 Page Object PatternsPattern 3 – Code walk through

Github : https://github.com/MattManickakumar/TestingTuesday

Page 48: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

48© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

11 Page Object Patterns

Pros & Cons

• Increased reusablity• Maintainable• structured development cycle• Robust & flexible to frequent changes

• Planning required• Senior mentorship required during test

design

Test automation challenges

Page 49: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

49© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

12 Tips

Page 50: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

50© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

12 Tips

Page 51: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

51© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

12 Tips

Xpaths

//*[@id="inline-search-collapse"]/form/div[1]/div[1]/div/div/select

//*[@id='inline-search-collapse']//label[text()='Kategori']/..//select

@FindBy(xpath=”.*")private WebElement Kategori;

Page 52: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

52© Capgemini 2019. All rights reserved |Presentation Title | Author | Date

Reference

Presentation Model

Supervising Model

Passive view

MVC

MVVM

Reference : https://martinfowler.com/https://www.joecolantonio.com/automation-testing-design-patterns/Book : A Journey through Test Automation Patterns by Sereta Gamba & Dorothy Graham

Inspiration

Page 53: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

53© Capgemini 2019. All rights reserved |

Questions

Page 54: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

54© Capgemini 2019. All rights reserved | 54© Capgemini 2019. All rights reserved |

Vil du lære mere? Så tag kurset ISTQB Advanced Test Automation

Testautomatisering med LEAPWORK

Andre interessante kurser inden for testautomatisering

Se mere her: https://www.capgemini.dk/Kursuskalender-2018/

Page 55: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

A global leader in consulting, technology services and digital transformation,Capgemini is at the forefront of innovation to address the entire breadth of clients’opportunities in the evolving world of cloud, digital and platforms. Building on itsstrong 50-year heritage and deep industry-specific expertise, Capgemini enablesorganizations to realize their business ambitions through an array of services fromstrategy to operations. Capgemini is driven by the conviction that the businessvalue of technology comes from and through people. It is a multicultural companyof over 200,000 team members in more than 40 countries. The Group reported2018 global revenues of EUR 13.2 billion.

About Capgemini

Learn more about us at

www.capgemini.com

This presentation contains information that may be privileged or confidential and is the property of the Capgemini Group.

Copyright © 2019 Capgemini. All rights reserved.

Page 56: Secret Ingredient for Automation Success · 3. Agenda. 01 Introduction. 02 Test Automation. 03 Tools & Frameworks. 04 Challenges from QualityReport. 05 Scope. 06 Working mechanism.

A global leader in consulting, technology services and digital transformation,Capgemini is at the forefront of innovation to address the entire breadth of clients’opportunities in the evolving world of cloud, digital and platforms. Building on itsstrong 50-year heritage and deep industry-specific expertise, Capgemini enablesorganizations to realize their business ambitions through an array of services fromstrategy to operations. Capgemini is driven by the conviction that the business valueof technology comes from and through people. It is a multicultural company of over200,000 team members in more than 40 countries. The Group reported 2018 globalrevenues of EUR 13.2 billion.

About Capgemini

Learn more about us at

www.capgemini.com

This presentation contains information that may be privileged or confidential and is the property of the Capgemini Group.Copyright © 2019 Capgemini. All rights reserved.

Name, Last NameTitle/RoleCapgemini Office (Optional)Address Line 1Address Line 2 Address Line 3

Name, Last NameTitle/RoleCapgemini Office (Optional)Address Line 1Address Line 2 Address Line 3

Name, Last NameTitle/RoleCapgemini Office (Optional)Address Line 1Address Line 2 Address Line 3

Name, Last NameTitle/RoleCapgemini Office (Optional)Address Line 1Address Line 2 Address Line 3

People matter, results count.