SlideShare a Scribd company logo
1 of 19
AutoTest refactoring
Current situation 
• 1 person-year 
• 300 Tests 
• 13k LOC 
• Per module: 
– Adapter.cs (1k LOC) 
– Scenarios.cs (1.5k LOC) 
– Test.cs (1k LOC) 
• Code style is horrible and not maintainable
Test.cs 
Scenarios.Login(); 
Scenarios.ExpandEnvinceTree(); 
Scenarios.ExpandCitationsSubtree(); 
Scenarios.ExpandCitationFolderInTree(citationFolderSrcHost.Name); 
Scenarios.CitationFolderCopyViaContextMenu(citationFolder.Name); 
Scenarios.InvokeCitationFolderContextMenuPaste(citationFolderDstHost.Name); 
Scenarios.CitationFolderCopyCutSetName(citationFolderInfo);
Scenarios.cs 
internal static void ConfirmAndBackToMangerCitations() 
{ 
Adapter.Otherframe.RefreshDomTree(); 
Adapter.CitationFolderConfirmButton.MouseClick(); 
Thread.Sleep(500); 
Adapter.Otherframe.RefreshDomTree(); 
Adapter.FolderOrCitationAfteractionReturnToManagerButton.MouseClick(); 
}
Adapter.cs 
public static Browser CitationsContextmenu 
{ 
get 
{ 
return ActiveBrowser.Frames.First<Browser>( 
a => a.FrameInfo.Id == "oCitationContextMenu_3"); 
} 
} 
public static HtmlAnchor CitationContextmenuProperties 
{ 
get 
{ 
return CitationsContextmenu. 
Find.ById<HtmlAnchor>("a_5"); 
} 
}
Refactoring?
Best practice 
google: autotest best practice 
• Split API and Tests 
•PageObject pattern in API 
• DSL and own Studio
Page Object examples
Simple Fields 
var loginPage = new LoginPage(); 
loginPage.UserName = “anton”; 
loginPage.Password = “password”; 
loginPage.SignIn();
Chained Menus 
mainPage 
.MainMenu.Open(“TasksAndWorkflows”,”Tasks”) 
.MainMenu.TasksAndWorkflows.Tasks();
DDL(Enums) and Checkbox 
page 
.SearchPanel.DueDate = DueDateType.Next_Week; 
.SearchPanel.MyTasks = true; 
.SearchPanel.Search();
Assert.AreEqual(page.Grid.Rows[0].TaskName, 
"shurik_03022012_40"); 
Assert.AreEqual(page.Grid.Rows[0].Status, 
"100%"); 
page.Grid.GoToPage(2); 
Grids
using (RequirementTemplateAssociationPopup popup = 
page.RequirementTemplate.Change()) 
{ 
popup.Grid.Rows[3].Select(); 
} 
Popups
Static vs Instance 
//Static 
LoginPage.Login(); 
MainFormPage.MainMenu.TasksAndWorkflows.Tasks(); 
TaskManagerPage.Grid.OpenContextMenu(0,1) 
.EditTaskPropertiesInBulk(); 
TaskBulkEditPage.AddNewSchedule(); 
TaskBulkEditPage.Save(); 
TaskBulkEditConfirmationPage.Confirm(); 
Assert.IsTrue(TaskManagerPage.Grid.Rows[0].IsNotSimpleTask);
Static vs Instance 
//Instance 
MainFormPage main = LoginPage.Login(); 
TaskManagerPage tasks = main.MainMenu.TasksAndWorkflows.Tasks(); 
TaskBulkEditPage bulk = tasks.Grid.OpenContextMenu(0, 1) 
.EditTaskPropertiesInBulk(); 
bulk.AddNewSchedule(); 
TaskBulkEditConfirmationPage confirm = bulk.Save(); 
tasks = confirm.Confirm(); 
Assert.IsTrue(tasks.Grid.Rows[0].IsNotSimpleTask);
Static vs Instance 
//Instance + var 
var main = LoginPage.Login(); 
var tasks = main.MainMenu.TasksAndWorkflows.Tasks(); 
var bulk = tasks.Grid.OpenContextMenu(0, 1) 
.EditTaskPropertiesInBulk(); 
bulk.AddNewSchedule(); 
var confirm = bulk.Save(); 
tasks = confirm.Confirm(); 
Assert.IsTrue(tasks.Grid.Rows[0].IsNotSimpleTask);
Static vs Instance 
//Instance + chain 
TaskBulkEditPage bulk = LoginPage.Login() 
.MainMenu.TasksAndWorkflows.Tasks() 
.Grid.OpenContextMenu(0, 1) 
.EditTaskPropertiesInBulk(); 
bulk.AddNewSchedule(); 
TaskManagerPage tasks = bulk 
.Save() 
.Confirm(); 
Assert.IsTrue(tasks.Grid.Rows[0].IsNotSimpleTask);
Summary 
• No hesitate small (or no dev.) projects – talk , 
suggest, review 
• Accept challenges in new areas 
• AutoTests 
– Split them on Tests and API 
– PageObject is very effective
Links 
• DSL, Page Object и Selenium – path to stable functional 
tests. Part1 
• DSL, Page Object и Selenium – path to stable functional 
tests. Part2 
• http://code.google.com/p/selenium/wiki/PageObjects 
• http://martinfowler.com/bliki/PageObject.html 
• http://www.ralphlavelle.net/2012/08/the-page-object-pattern- 
for-ui-tests.html 
• http://docs.seleniumhq.org/docs/06_test_design_cons 
iderations.jsp#chapter06-reference 
• http://sqa.stackexchange.com/

More Related Content

What's hot

NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBSqreen
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Zianed Hou
 
Bkbiet day2 & 3
Bkbiet day2 & 3Bkbiet day2 & 3
Bkbiet day2 & 3mihirio
 
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Arian Gutierrez
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genMongoDB
 
Service Functions
Service FunctionsService Functions
Service Functionspineda2
 
The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189Mahmoud Samir Fayed
 
아파트 정보를 이용한 ELK stack 활용 - 오근문
아파트 정보를 이용한 ELK stack 활용 - 오근문아파트 정보를 이용한 ELK stack 활용 - 오근문
아파트 정보를 이용한 ELK stack 활용 - 오근문NAVER D2
 
AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals Adam Book
 
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! GrailsプラグインTsuyoshi Yamamoto
 
บทที่6 update&delete
บทที่6 update&deleteบทที่6 update&delete
บทที่6 update&deletePalm Unnop
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part AKazuchika Sekiya
 
ReactJS & Material-ui Hello world
ReactJS & Material-ui Hello worldReactJS & Material-ui Hello world
ReactJS & Material-ui Hello worldDaniel Lim
 
Do something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appDo something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appBruce McPherson
 
20110514 mongo dbチューニング
20110514 mongo dbチューニング20110514 mongo dbチューニング
20110514 mongo dbチューニングYuichi Matsuo
 

What's hot (18)

NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDB
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
 
Bkbiet day2 & 3
Bkbiet day2 & 3Bkbiet day2 & 3
Bkbiet day2 & 3
 
Mongo db for c# developers
Mongo db for c# developersMongo db for c# developers
Mongo db for c# developers
 
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10gen
 
Mongo db for C# Developers
Mongo db for C# DevelopersMongo db for C# Developers
Mongo db for C# Developers
 
Service Functions
Service FunctionsService Functions
Service Functions
 
The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189
 
아파트 정보를 이용한 ELK stack 활용 - 오근문
아파트 정보를 이용한 ELK stack 활용 - 오근문아파트 정보를 이용한 ELK stack 활용 - 오근문
아파트 정보를 이용한 ELK stack 활용 - 오근문
 
AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals
 
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
 
บทที่6 update&delete
บทที่6 update&deleteบทที่6 update&delete
บทที่6 update&delete
 
Good Tests Bad Tests
Good Tests Bad TestsGood Tests Bad Tests
Good Tests Bad Tests
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
 
ReactJS & Material-ui Hello world
ReactJS & Material-ui Hello worldReactJS & Material-ui Hello world
ReactJS & Material-ui Hello world
 
Do something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appDo something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing app
 
20110514 mongo dbチューニング
20110514 mongo dbチューニング20110514 mongo dbチューニング
20110514 mongo dbチューニング
 

Viewers also liked

Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyGiovanni Toraldo
 
從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用謝 宗穎
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境謝 宗穎
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingStephan Cadene
 
Dockerのキホンその2 Docker Compose Swarm Machine 利用編
Dockerのキホンその2 Docker Compose Swarm Machine 利用編Dockerのキホンその2 Docker Compose Swarm Machine 利用編
Dockerのキホンその2 Docker Compose Swarm Machine 利用編Naoki Nagazumi
 
Docker Swarm: Docker Native Clustering
Docker Swarm: Docker Native ClusteringDocker Swarm: Docker Native Clustering
Docker Swarm: Docker Native ClusteringDocker, Inc.
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introductionEvan Lin
 
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Docker, Inc.
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiMike Goelzer
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker, Inc.
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usagevincentvdk
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntuSim Janghoon
 
Docker Swarm Cluster
Docker Swarm ClusterDocker Swarm Cluster
Docker Swarm ClusterFernando Ike
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework DesignsSauce Labs
 

Viewers also liked (18)

Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
 
從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
 
Dockerのキホンその2 Docker Compose Swarm Machine 利用編
Dockerのキホンその2 Docker Compose Swarm Machine 利用編Dockerのキホンその2 Docker Compose Swarm Machine 利用編
Dockerのキホンその2 Docker Compose Swarm Machine 利用編
 
Docker Swarm: Docker Native Clustering
Docker Swarm: Docker Native ClusteringDocker Swarm: Docker Native Clustering
Docker Swarm: Docker Native Clustering
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introduction
 
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
 
Dokcer swarm
Dokcer swarmDokcer swarm
Dokcer swarm
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntu
 
Docker Swarm Cluster
Docker Swarm ClusterDocker Swarm Cluster
Docker Swarm Cluster
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 

Similar to Code refactoring of existing AutoTest to PageObject pattern

COScheduler In Depth
COScheduler In DepthCOScheduler In Depth
COScheduler In DepthWO Community
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42Yevhen Bobrov
 
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Sirar Salih
 
Sustaining Test-Driven Development
Sustaining Test-Driven DevelopmentSustaining Test-Driven Development
Sustaining Test-Driven DevelopmentAgileOnTheBeach
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3Simon Su
 
Test-driven Development with AEM
Test-driven Development with AEMTest-driven Development with AEM
Test-driven Development with AEMJan Wloka
 
Practical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich ClientsPractical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich ClientsRichard Bair
 
Event Sourcing - what could go wrong - Devoxx BE
Event Sourcing - what could go wrong - Devoxx BEEvent Sourcing - what could go wrong - Devoxx BE
Event Sourcing - what could go wrong - Devoxx BEAndrzej Ludwikowski
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkDavid Rajah Selvaraj
 
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesVielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesQAware GmbH
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksMongoDB
 
Unit Testing at Scale
Unit Testing at ScaleUnit Testing at Scale
Unit Testing at ScaleJan Wloka
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project WonderWO Community
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgetsscottw
 
NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportAnton Arhipov
 

Similar to Code refactoring of existing AutoTest to PageObject pattern (20)

COScheduler In Depth
COScheduler In DepthCOScheduler In Depth
COScheduler In Depth
 
Requery overview
Requery overviewRequery overview
Requery overview
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42
 
ERRest
ERRestERRest
ERRest
 
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
 
Sustaining Test-Driven Development
Sustaining Test-Driven DevelopmentSustaining Test-Driven Development
Sustaining Test-Driven Development
 
Unit testing with mock libs
Unit testing with mock libsUnit testing with mock libs
Unit testing with mock libs
 
Clean Code - A&BP CC
Clean Code - A&BP CCClean Code - A&BP CC
Clean Code - A&BP CC
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 
Test-driven Development with AEM
Test-driven Development with AEMTest-driven Development with AEM
Test-driven Development with AEM
 
Practical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich ClientsPractical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich Clients
 
Event Sourcing - what could go wrong - Devoxx BE
Event Sourcing - what could go wrong - Devoxx BEEvent Sourcing - what could go wrong - Devoxx BE
Event Sourcing - what could go wrong - Devoxx BE
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
 
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesVielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
 
Unit Testing at Scale
Unit Testing at ScaleUnit Testing at Scale
Unit Testing at Scale
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project Wonder
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgets
 
Qtp test
Qtp testQtp test
Qtp test
 
NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience Report
 

Recently uploaded

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Code refactoring of existing AutoTest to PageObject pattern

  • 2. Current situation • 1 person-year • 300 Tests • 13k LOC • Per module: – Adapter.cs (1k LOC) – Scenarios.cs (1.5k LOC) – Test.cs (1k LOC) • Code style is horrible and not maintainable
  • 3. Test.cs Scenarios.Login(); Scenarios.ExpandEnvinceTree(); Scenarios.ExpandCitationsSubtree(); Scenarios.ExpandCitationFolderInTree(citationFolderSrcHost.Name); Scenarios.CitationFolderCopyViaContextMenu(citationFolder.Name); Scenarios.InvokeCitationFolderContextMenuPaste(citationFolderDstHost.Name); Scenarios.CitationFolderCopyCutSetName(citationFolderInfo);
  • 4. Scenarios.cs internal static void ConfirmAndBackToMangerCitations() { Adapter.Otherframe.RefreshDomTree(); Adapter.CitationFolderConfirmButton.MouseClick(); Thread.Sleep(500); Adapter.Otherframe.RefreshDomTree(); Adapter.FolderOrCitationAfteractionReturnToManagerButton.MouseClick(); }
  • 5. Adapter.cs public static Browser CitationsContextmenu { get { return ActiveBrowser.Frames.First<Browser>( a => a.FrameInfo.Id == "oCitationContextMenu_3"); } } public static HtmlAnchor CitationContextmenuProperties { get { return CitationsContextmenu. Find.ById<HtmlAnchor>("a_5"); } }
  • 7. Best practice google: autotest best practice • Split API and Tests •PageObject pattern in API • DSL and own Studio
  • 9. Simple Fields var loginPage = new LoginPage(); loginPage.UserName = “anton”; loginPage.Password = “password”; loginPage.SignIn();
  • 10. Chained Menus mainPage .MainMenu.Open(“TasksAndWorkflows”,”Tasks”) .MainMenu.TasksAndWorkflows.Tasks();
  • 11. DDL(Enums) and Checkbox page .SearchPanel.DueDate = DueDateType.Next_Week; .SearchPanel.MyTasks = true; .SearchPanel.Search();
  • 13. using (RequirementTemplateAssociationPopup popup = page.RequirementTemplate.Change()) { popup.Grid.Rows[3].Select(); } Popups
  • 14. Static vs Instance //Static LoginPage.Login(); MainFormPage.MainMenu.TasksAndWorkflows.Tasks(); TaskManagerPage.Grid.OpenContextMenu(0,1) .EditTaskPropertiesInBulk(); TaskBulkEditPage.AddNewSchedule(); TaskBulkEditPage.Save(); TaskBulkEditConfirmationPage.Confirm(); Assert.IsTrue(TaskManagerPage.Grid.Rows[0].IsNotSimpleTask);
  • 15. Static vs Instance //Instance MainFormPage main = LoginPage.Login(); TaskManagerPage tasks = main.MainMenu.TasksAndWorkflows.Tasks(); TaskBulkEditPage bulk = tasks.Grid.OpenContextMenu(0, 1) .EditTaskPropertiesInBulk(); bulk.AddNewSchedule(); TaskBulkEditConfirmationPage confirm = bulk.Save(); tasks = confirm.Confirm(); Assert.IsTrue(tasks.Grid.Rows[0].IsNotSimpleTask);
  • 16. Static vs Instance //Instance + var var main = LoginPage.Login(); var tasks = main.MainMenu.TasksAndWorkflows.Tasks(); var bulk = tasks.Grid.OpenContextMenu(0, 1) .EditTaskPropertiesInBulk(); bulk.AddNewSchedule(); var confirm = bulk.Save(); tasks = confirm.Confirm(); Assert.IsTrue(tasks.Grid.Rows[0].IsNotSimpleTask);
  • 17. Static vs Instance //Instance + chain TaskBulkEditPage bulk = LoginPage.Login() .MainMenu.TasksAndWorkflows.Tasks() .Grid.OpenContextMenu(0, 1) .EditTaskPropertiesInBulk(); bulk.AddNewSchedule(); TaskManagerPage tasks = bulk .Save() .Confirm(); Assert.IsTrue(tasks.Grid.Rows[0].IsNotSimpleTask);
  • 18. Summary • No hesitate small (or no dev.) projects – talk , suggest, review • Accept challenges in new areas • AutoTests – Split them on Tests and API – PageObject is very effective
  • 19. Links • DSL, Page Object и Selenium – path to stable functional tests. Part1 • DSL, Page Object и Selenium – path to stable functional tests. Part2 • http://code.google.com/p/selenium/wiki/PageObjects • http://martinfowler.com/bliki/PageObject.html • http://www.ralphlavelle.net/2012/08/the-page-object-pattern- for-ui-tests.html • http://docs.seleniumhq.org/docs/06_test_design_cons iderations.jsp#chapter06-reference • http://sqa.stackexchange.com/