SlideShare a Scribd company logo
OPEN SOURCE UI
AUTOMATION ON C#
2 MARCH 2017
Chief QA Automation
In Testing more than 11 years
In Testing Automation 9 years
ROMAN IOVLEV
3
?
4
JDI SETUP
README
http://jdi.epam.com/
https://github.com/epam/JDI
https://vk.com/jdi_framework
5
FAQ
SIMPLE TEST
ProductPage.ProductType.Select(«jacket»);
ProductPage.Price.select(«500$»);
ProductPage.Colors.check(«black», «white»);
Assert.isTrue(ProductPage.Label.getText(),
«Armani Jacket»)
6
SIMPLE TEST
LoginPage.Open();
LoginPage.LoginForm.Login(admin);
SearchPage.Search.Find(«Cup»);
Assert.AreEqual(ResultsPage.Products.Count(), expected);
7
PAGE ELEMENTS
8
PAGE OBJECTS
Tests Page Objects
Driver
(Engine)
Application
ELEMENTS
private IWebElement UserName;
private IWebElement Password;
private IWebElement LoginButton;
• ACTIONS
• EnterUserName(String name);
• EnterPassword(String name);
• ClickLoginButton();
• BUSINESS ACTIONS
• Login(User user)
9
PAGE ELEMENTS
ELEMENTS
public TextField UserName;
public TextField Password;
public Button LoginButton;
• ACTIONS
• ---
• BUSINESS ACTIONS
• Login(User user)
ELEMENT
public DropDown UserStatus;
• ACTIONS
• Select(string option)
• boolean IsSelcted()
• List<String> AllOptions()
• string GetValue()
10
ELEMENTS
 Simple
 Complex
 Composite
11
SIMPLE
ELEMENTS
12
SIMPLE ELEMENTS
[FindBy (Css=“.description”)]
public Text Description;
public Button Submit;
public Label ProductName;
public Link FollowMe;
public TextField Password;
public TextArea Abuse;
public CheckBox RememberMe;
public DatePicker Date;
public FileInput Upload;
public Image Photo;
13
NEWS
SIMPLE ELEMENTS
[FindBy(Css=“.btn”) ]
public Button submit;
14
[FindBy(Css=“.btn”) ]
[FindBy(Xpath=“//button”) ]
[FindBy(Id=“button-id”) ]
[FindBy(Name=“button”) ]
[FindBy(Css=“.btn”) ]
public Button submit =
new Button(By.Css(“.btn”));
[FindBy(Css=“.btn”) ]
public IButton submit;
MULTILOCATORS
15
Multi language testing
[JFindBy (text=“Submit”, group=“en”) ]
[JFindBy (text=“Отправить” , group=“ru”) ]
public Button submit;
Multi version testing
[JFindBy(text=“Submit”, group=“1.7”) ]
[JFindBy(value=“Submit” , group=“2.0”) ]
public Button submit;
PLATO'S THEORY OF FORMS
5
No application but you can write UI Objects (Page Objects )
IButton
COMPLEX
ELEMENTS
17
COMPLEX ELEMENTS
public Dropdown Colors;
public Checklist Settings;
public ComboBox Tags;
public DropList ShirtSizes;
public List<Element> SearchResults;
public Elements Reviews;
public Table Products;
public Menu MainMenu;
public Tabs Areas;
public Selector Vote;
public RadioButtons Rating;
public TextList Chat; 18
COMPLEX ELEMENTS
[FindBy (Css = “.colors") ]
public Dropdown colors = new Dropdown {
Value = By.Css(".value"),
List = By.TagName(“li")
};
19
[FindBy (Css = “.offers") ]
public Table offers = new Table {
Row = By.Css(".value"),
Column = By.TagName(“li"),
Header = new [] {“ID", “Title", “Apply”}
};
COMPLEX ELEMENTS
[FindBy (Css = “.colors") ]
public Dropdown Colors;
[FindBy (Css = “.table”) ]
public Table Offers;
20
[FindBy (Css = “.menu li”) ]
public Menu Navigation;
[FindBy (Css = “.menu ul”) ]
public Menu Navigation;
[FindBy (Xpath = “//*[@class=‘menu’]//li[text()=‘%s’]”) ]
public Menu Navigation;
• Code readability
• Clear behavior
• Union of all element’s locators
• Union of element and its actions
• Detailed logging
TYPIFIED ELEMENTS
21
Text Description;
Button Submit;
Label ProductName;
Link FollowMe;
TextField Password;
TextArea Abuse;
CheckBox RememberMe;
DatePicker Date;
FileInput Upload;
Image Photo;
IWebElement Description;
IWebElement SubmitButton;
IWebElement ProductName;
IWebElement FollowMeLink;
IWebElement PasswordField;
IWebElement Abuse;
IWebElement RememberMe;
IWebElement DatePicker;
IWebElement Upload;
IWebElement Photo;
COMPARE
22
COMPARE
[FindBy(css = “.colors") ]
public Dropdown colors = new Dropdown {
Value = By.Css(".value"),
List = By.TagName(“li") };
[FindBy(Css = “.colors .value") ]
IWebElement ColorsValue;
[FindBy (Css = “.colors li") ]
List<IWebElement> ColorsList;
public string GetColor() {
return ColorsValue.GetText();
}
public void SelectColor(String ColorName) {
ColorsValue.Click();
for (IWebElement Color : ColorsList)
if (Color.getText().Equals(ColorName) {
Color.Click();
return;
} 23
COMPARE
[FindBy (Id = “trades") ]
public Table Colors;
[FindBy (Id = “…") ]
private List<IWebElement> ResultsColHeaders;
[FindBy (Id = “…") ]
private List<IWebElement> ResultsRowsHeaders;
[FindBy (Id = “…") ]
private List<IWebElement> ResultsCellsHeaders;
[FindBy (Id = “…") ]
private List<IWebElement> ResultsColumn;
[FindBy (Id = “…") ]
private List<IWebElement> ResultsRow;
ICell cell(Column column, Row row) { }
ICell cell(String columnName, String
rowName) { }
ICell cell(int columnIndex, int rowIndex) { }
List<ICell> cells(String value) { }
List<ICell> cellsMatch(String regex) { }
ICell cell(String value) { }
ICell cellMatch(String regex) { }
MapArray<String, MapArray<String, ICell>>
rows(String... colNameValues) { }
MapArray<String, MapArray<String, ICell>>
columns(String... rowNameValues) { }
boolean waitValue(String value, Row row) { }
boolean waitValue(String value, Column
column) { }
boolean isEmpty() { }
boolean waitHaveRows() { }
boolean waitRows(int count) { }
ICell cell(String value, Row row) { }
ICell cell(String value, Column column) { }
List<ICell> cellsMatch(String regex, Row row) {
}
List<ICell> cellsMatch(String regex, Column
column) { }
MapArray<String, ICell> row(String value,
Column column) { }
MapArray<String, ICell> column(String value,
Row row) { }
MapArray<String, ICell> row(int rowNum) { }
MapArray<String, ICell> row(String rowName)
{ }
List<String> rowValue(int colNum) { }
List<String> rowValue(String colName) { }
MapArray<String, ICell> column(int colNum) {
}
MapArray<String, ICell> column(String
colName) { }
List<String> columnValue(int colNum) { }
List<String> columnValue(String colName) { }
MapArray<String, SelectElement> header() { }
SelectElement header(String name) { }
List<String> headers() { }
List<String> footer() { }
List<ICell> getCells() { }
void clean() { }
void clear() { }
ITable useCache(boolean value) { }
ITable useCache() { }
Table clone() { }
Table copy() { }
ITable hasAllHeaders() { }
ITable hasNoHeaders() { }
ITable hasOnlyColumnHeaders() { }
ITable hasOnlyRowHeaders() { }
ITable hasColumnHeaders(List<String> value)
{ }
<THeaders extends Enum> ITable
hasColumnHeaders(Class<THeaders> headers)
{ }
ITable hasRowHeaders(List<String> value) { }
<THeaders extends Enum> ITable
hasRowHeaders(Class<THeaders> headers) { }
ITable setColumnsCount(int value) { }
ITable setRowsCount(int value) { }
24
COMPOSITE
ELEMENTS
25
public class Header : Section
[JPage (Url = "/index.html", Title = “Good site") ]
public class HomePage : WebPage
[JSite (Domain = “http://epam.com/") ]
public class EpamSite : WebSite
public class LoginForm : Form
public class SearchBar : Search
public class Alert : Popup
public class Navigation : Pagination
26
COMPOSITE ELEMENTS
[JPage (domain = “http://epam.com/") ]
public class EpamSite : WebSite {
[JPage (Url = "/index.html") ]
public static HomePage homepage;
[JPage (Url = "/login", Title = “Login page") ]
public static LoginPage loginPage;
[FindBy (Сss=“.nav”) ]
public static Menu navigation;
}
27
WEB SITE
public static void SetUp() {
WebSite.Init(typeof(EpamSite));
}
[JPage (Url = "/main", Title = "Good site", UrlTemplate = “/main?d{10}“,
UrlCheckType = MATCH, TitleCheckType = CONTAINS) ]
public class HomePage : WebPage
28
WEB PAGE
homepage.Open();
homepage.CheckOpened();
homepage.IsOpened();
homepage.Refresh();
homepage.Back();
homepage.Forward();
homepage.AddCookie();
homepage.ClearCache();
USAGE
public class Header : Section {
[FindBy (Сss=“.submit”) ]
public Button submit;
[FindBy (Сss=“.followMe”) ]
public Link followMe;
[FindBy (Сss=“.navigation”) ]
public Menu navigation;
public void openAbout() {
followMe.Click();
navigation.Select(ABOUT);
}
}
29
SECTION
header.Submit.Click();
header.Menu.IsSelected();
header.OpenAbout();
USAGE
ENTITY DRIVEN
TESTING
30
EDT: DATA DRIVEN TESTING
31
 Provide List<User> for test
EDT: PRECONDITIONS
32
 Provide List<User> for test
0. Have DefaultUser in DB
EDT: FILL AND SUBMIT
33
 Provide List<User> for test
0. Have DefaultUser in DB
1. Login with DefaultUser
EDT: FILL AND SEND
34
 Provide List<User> for test
0. Have DefaultUser in DB
1. Login with DefaultUser
2. Submit Contact Us Form for DefaultUser
EDT: EXTRACT
35
 Provide List<User> for test
0. Have DefaultUser in DB
1. Login with DefaultUser
2. Submit Contact Us Form for DefaultUser
3. Get Act. Opening from Vacancy table
EDT: VALIDATE
36
 Provide List<User> for test
0. Have DefaultUser in DB
1. Login with DefaultUser
2. Submit Contact Us Form for DefaultUser
3. Get Act. Opening from Vacancy table
4. Assert Act. Opening equals to Exp. Opening
ExpectedActual
public class LoginForm extends Form<User> {
[FindBy (Сss=“.login”)
public TextField Login;
[FindBy (Сss=“.psw”)
public TextField Password;
[FindBy (Сss=“.submit”)
public Button Submit;
[FindBy (Сss=“.cancel”)
public Button Cancel;
}
37
FORM
public class User {
public String Login = “roman”;
public String Password = null;
}
[Test]
public class SimpleTest(User User) {
loginForm.login(user);
…
}
[Test]
public void FormTest(User Admin) {
LoginForm.LoginAs(Admin);
Filter.Select(Admin.name);
Assert.Each(Results).Contains(Admin.Name);
Results.get(1);
PayForm.Submit(Admin.CreditCard);
Assert.AreEquals(DB.Transactions[1]),
Admin.CreditCard);
}
38
ENTITY DRIVEN TESTING
LoginForm.Fill(User);
LoginForm.Submit(User);
LoginForm.Verify(User);
LoginForm.Check(User);
LoginForm.Cancel(User);
LoginForm.Save(User);
LoginForm.Publish(User);
LoginForm.Search(User);
LoginForm.Update(User);
…
USAGE
[FindBy (Css = “.offers") ]
public Table<Job, JobRecord> Offers = new Table {
Row = By.Css(".value"),
Column = By.TagName(“li"),
Header = new [] {“ID", “Title", “Apply”}
};
39
[FindBy (Css = ".list.ui-sortable") ]
public Elements<FilmCard> FilmCards;
FilmCards[name].Title.GetText();
40
ELEMENTS
41
OTHER UI OBJECTS
public class SearchBar : Search { }
public class Navigation : Pagination { }
public class Confirmation : Popup { }
…
public class MyCustom : CustomObject { }
// implements IComposite
UI OBJECTS
PATTERN
42
43
UI OBJECTS
44
UI OBJECTS
45
UI OBJECTS
46
UI OBJECTS
INTERFACES
47
48
TEST ANY UI
Your Engine (Driver)
49
JDI ARCHITECTURE
Commons
Core
Matchers
Web, Mobile, Gui …
public interface ICheckBox
extends IClickable, ISetValue {
void Check();
void Uncheck();
boolean IsChecked();
}
INTERFACES
IElement
ISelector
IComposite
IPage
IHasValue
ISetValue
IButton
ICheckBox
IDatePicker
IFileInput
IImage
ILabel
ILink
IText
ITextArea
ITextField
ICheckList
IComboBox
IDropDown
IDropList
IForm
IGroup
IMenu
IPage
IPagination
IPopup
IRadioButtons
ISearch
ISelector
ITabs
ITextList
FOR BUSINESS
50
• Write test code faster up to 5 times
• Average result around 2.8 times
• 4.7 times speedup on the project with standard implementation
• Produce less amount of test code (loc) up to 3 times
• Average result around 2.1 times
• 2.8 times reduction on the project with standard implementation
• Achieve higher clearness of tests
• Decrease of support time for test projects
• Lowering of project entry barrier for newcomers
• Complete projects with higher quality
• Based on 70 % answers in survey
51
JDI BENEFITS
• Reuse investments from one Project on another
• Based on 5 years of work and more than 30 projects that already use JDI
• Save up to 80% test effort by migrating tests to other Platforms
• Based estimated average scope reductions for all test process stages
• Example: migrate Web tests to Mobile platform
• Can be used in most of projects with UI Automation
• Actually we have no projects where JDI is not applicable. The only reason why not all of our
projects use JDI is Client requirements
• Save up to 30-40% money from whole test process
• Based on average calculation of scope reductions for all test process stages
52
JDI BENEFITS
FUTURE
53
LOG IN BDD STYLE
I select ‘jacket’ ProductType on ProductPage
I select ‘500$’ Price on ProductPage
I check ‘black’ and ‘white’ Colors on ProductPage
54
ProductPage.ProductType.select(«jacket»);
ProductPage.Price.select(«500$»);
ProductPage.Colors.check(«black», «white»);
• Chrome plugin
• Get ui elements to page object in browser
• Auto generation
55
GENERATED PAGE OBJECTS
public class LoginForm extends Form<User> {
@FindBy (css=“.login”)
public TextField login;
@FindBy (css=“.psw”)
public TextField password;
@FindBy (css=“.submit”)
public Button login;
}
56
SERVICES PAGE OBJECTS
@ServiceDomain(“http://service.com”)
public class ServiceExample {
@GET (“/color/get”)
public RestMethod getColor;
@POST (“/color/change/100”)
public RestMethod changeColor;
}
Auto generation by WSDL
57
DB TESTING SUPPORT
58
SIMPLE TESTS GENERATOR
59
SUPPORT MAIN UI DEV FRAMEWORKS
60
PERFORMANCE / STATISTIC
61
SNIFF HTTP REQUESTS
62
SUPPORT JS / PHYTON
63
ENJOY
64
CONTACTS
http://jdi.epam.com/
https://vk.com/jdi_framework
https://github.com/epam/JDI
roman.Iovlev
roman_iovlev@epam.com

More Related Content

What's hot (17)

PDF
Dollar symbol
Aaron Huang
 
PPTX
jQuery Fundamentals
Gil Fink
 
PDF
Quick Intro to Android Development
Jussi Pohjolainen
 
PDF
Learning jQuery made exciting in an interactive session by one of our team me...
Thinqloud
 
PDF
Laravel 로 배우는 서버사이드 #5
성일 한
 
PDF
jQuery Basic API
Hyeonseok Shin
 
PDF
jQuery%20on%20Rails%20Presentation
guestcf600a
 
PDF
jQuery Essentials
Marc Grabanski
 
PDF
Jqeury ajax plugins
Inbal Geffen
 
PPT
Beginning iphone 4_devlopement_chpter7_tab_b
Jihoon Kong
 
PPTX
JQuery
SelmanJagxhiu
 
ODP
Introduction to jQuery
manugoel2003
 
PDF
Rediscovering JavaScript: The Language Behind The Libraries
Simon Willison
 
PDF
Prototype & jQuery
Remy Sharp
 
PPT
Jquery 3
Manish Kumar Singh
 
PDF
Introduction to jQuery
Seble Nigussie
 
PDF
Crowdsourcing with Django
Simon Willison
 
Dollar symbol
Aaron Huang
 
jQuery Fundamentals
Gil Fink
 
Quick Intro to Android Development
Jussi Pohjolainen
 
Learning jQuery made exciting in an interactive session by one of our team me...
Thinqloud
 
Laravel 로 배우는 서버사이드 #5
성일 한
 
jQuery Basic API
Hyeonseok Shin
 
jQuery%20on%20Rails%20Presentation
guestcf600a
 
jQuery Essentials
Marc Grabanski
 
Jqeury ajax plugins
Inbal Geffen
 
Beginning iphone 4_devlopement_chpter7_tab_b
Jihoon Kong
 
Introduction to jQuery
manugoel2003
 
Rediscovering JavaScript: The Language Behind The Libraries
Simon Willison
 
Prototype & jQuery
Remy Sharp
 
Introduction to jQuery
Seble Nigussie
 
Crowdsourcing with Django
Simon Willison
 

Similar to Роман Иовлев «Open Source UI Automation Tests on C#» (20)

PDF
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
Heiko Behrens
 
PDF
MVVM with SwiftUI and Combine
Tai Lun Tseng
 
PPTX
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
SQALab
 
PDF
SwiftUI and Combine All the Things
Scott Gardner
 
PDF
Revolution or Evolution in Page Object
Artem Sokovets
 
PDF
Introduzione JQuery
orestJump
 
PPTX
A test framework out of the box - Geb for Web and mobile
GlobalLogic Ukraine
 
PDF
Action bar
Mu Chun Wang
 
PDF
IN4308 Lecture 3
Eelco Visser
 
PDF
jQuery Rescue Adventure
Allegient
 
PDF
Android Design Patterns
Godfrey Nolan
 
PDF
Beautiful java script
Ürgo Ringo
 
PDF
APPlause - DemoCamp Munich
Peter Friese
 
KEY
UIWebView Tips
Katsumi Kishikawa
 
PPTX
Web Development Course - JQuery by RSOLUTIONS
RSolutions
 
PPTX
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
PDF
MOPCON 2014 - Best software architecture in app development
anistar sung
 
PPTX
Iniciando com jquery
Danilo Sousa
 
PDF
Aplicacoes dinamicas Rails com Backbone
Rafael Felix da Silva
 
PPTX
Geb qa fest2017
Sviatkin Yaroslav
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
Heiko Behrens
 
MVVM with SwiftUI and Combine
Tai Lun Tseng
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
SQALab
 
SwiftUI and Combine All the Things
Scott Gardner
 
Revolution or Evolution in Page Object
Artem Sokovets
 
Introduzione JQuery
orestJump
 
A test framework out of the box - Geb for Web and mobile
GlobalLogic Ukraine
 
Action bar
Mu Chun Wang
 
IN4308 Lecture 3
Eelco Visser
 
jQuery Rescue Adventure
Allegient
 
Android Design Patterns
Godfrey Nolan
 
Beautiful java script
Ürgo Ringo
 
APPlause - DemoCamp Munich
Peter Friese
 
UIWebView Tips
Katsumi Kishikawa
 
Web Development Course - JQuery by RSOLUTIONS
RSolutions
 
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
MOPCON 2014 - Best software architecture in app development
anistar sung
 
Iniciando com jquery
Danilo Sousa
 
Aplicacoes dinamicas Rails com Backbone
Rafael Felix da Silva
 
Geb qa fest2017
Sviatkin Yaroslav
 
Ad

More from SpbDotNet Community (20)

PPTX
Станислав Флусов «Sharing общих сборок между процессами и доменами в IIS»
SpbDotNet Community
 
PPTX
Егор Гришечко «У вас найдётся минутка, чтобы поговорить о блокчейне?»
SpbDotNet Community
 
PDF
Константин Васильев «Fody против рутины»
SpbDotNet Community
 
PDF
Павел Федотовский «Как мы разрабатывали приложение для DotNetRu на Xamarin.Fo...
SpbDotNet Community
 
PDF
Слава Бобик «NancyFx для самых маленьких»
SpbDotNet Community
 
PDF
Иван Кожин «Saritasa Tools или ещё один подход к архитектуре приложения»
SpbDotNet Community
 
PDF
Игорь Лабутин «Коллекционируем данные в .NET»
SpbDotNet Community
 
PDF
Станислав Сидристый «Шаблон Lifetime: для сложного Disposing»
SpbDotNet Community
 
PDF
Артём Акуляков - F# for Data Analysis
SpbDotNet Community
 
PPTX
Анатолий Кулаков «The Metrix has you…»
SpbDotNet Community
 
PPTX
Роман Неволин «Провайдеры типов без боли и магии»
SpbDotNet Community
 
PDF
Дмитрий Верескун «Синтаксический сахар C#»
SpbDotNet Community
 
PDF
Александр Саитов «Основы профилирования и оптимизации приложений в .NET»
SpbDotNet Community
 
PDF
Сергей Лёвкин «Технологии Microsoft для актуальных трендов»
SpbDotNet Community
 
PDF
Алексей Мерсон «Domain Driven Design: профит малой кровью»
SpbDotNet Community
 
PPTX
Егор Гришечко «Async/Await и всё, что вы боялись спросить»
SpbDotNet Community
 
PPTX
Михаил Щербаков «Что может быть проще: делегаты и события»
SpbDotNet Community
 
PDF
Никита Каменский «Есть ли жизнь с UWP?»
SpbDotNet Community
 
PPTX
Александр Кугушев «Roslyn: очевидные неочевидности»
SpbDotNet Community
 
PPTX
ДотаНетоЛогия: СПб 2017
SpbDotNet Community
 
Станислав Флусов «Sharing общих сборок между процессами и доменами в IIS»
SpbDotNet Community
 
Егор Гришечко «У вас найдётся минутка, чтобы поговорить о блокчейне?»
SpbDotNet Community
 
Константин Васильев «Fody против рутины»
SpbDotNet Community
 
Павел Федотовский «Как мы разрабатывали приложение для DotNetRu на Xamarin.Fo...
SpbDotNet Community
 
Слава Бобик «NancyFx для самых маленьких»
SpbDotNet Community
 
Иван Кожин «Saritasa Tools или ещё один подход к архитектуре приложения»
SpbDotNet Community
 
Игорь Лабутин «Коллекционируем данные в .NET»
SpbDotNet Community
 
Станислав Сидристый «Шаблон Lifetime: для сложного Disposing»
SpbDotNet Community
 
Артём Акуляков - F# for Data Analysis
SpbDotNet Community
 
Анатолий Кулаков «The Metrix has you…»
SpbDotNet Community
 
Роман Неволин «Провайдеры типов без боли и магии»
SpbDotNet Community
 
Дмитрий Верескун «Синтаксический сахар C#»
SpbDotNet Community
 
Александр Саитов «Основы профилирования и оптимизации приложений в .NET»
SpbDotNet Community
 
Сергей Лёвкин «Технологии Microsoft для актуальных трендов»
SpbDotNet Community
 
Алексей Мерсон «Domain Driven Design: профит малой кровью»
SpbDotNet Community
 
Егор Гришечко «Async/Await и всё, что вы боялись спросить»
SpbDotNet Community
 
Михаил Щербаков «Что может быть проще: делегаты и события»
SpbDotNet Community
 
Никита Каменский «Есть ли жизнь с UWP?»
SpbDotNet Community
 
Александр Кугушев «Roslyn: очевидные неочевидности»
SpbDotNet Community
 
ДотаНетоЛогия: СПб 2017
SpbDotNet Community
 
Ad

Recently uploaded (20)

PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 

Роман Иовлев «Open Source UI Automation Tests on C#»

  • 1. OPEN SOURCE UI AUTOMATION ON C# 2 MARCH 2017
  • 2. Chief QA Automation In Testing more than 11 years In Testing Automation 9 years ROMAN IOVLEV
  • 3. 3 ?
  • 9. PAGE OBJECTS Tests Page Objects Driver (Engine) Application ELEMENTS private IWebElement UserName; private IWebElement Password; private IWebElement LoginButton; • ACTIONS • EnterUserName(String name); • EnterPassword(String name); • ClickLoginButton(); • BUSINESS ACTIONS • Login(User user) 9
  • 10. PAGE ELEMENTS ELEMENTS public TextField UserName; public TextField Password; public Button LoginButton; • ACTIONS • --- • BUSINESS ACTIONS • Login(User user) ELEMENT public DropDown UserStatus; • ACTIONS • Select(string option) • boolean IsSelcted() • List<String> AllOptions() • string GetValue() 10
  • 13. SIMPLE ELEMENTS [FindBy (Css=“.description”)] public Text Description; public Button Submit; public Label ProductName; public Link FollowMe; public TextField Password; public TextArea Abuse; public CheckBox RememberMe; public DatePicker Date; public FileInput Upload; public Image Photo; 13 NEWS
  • 14. SIMPLE ELEMENTS [FindBy(Css=“.btn”) ] public Button submit; 14 [FindBy(Css=“.btn”) ] [FindBy(Xpath=“//button”) ] [FindBy(Id=“button-id”) ] [FindBy(Name=“button”) ] [FindBy(Css=“.btn”) ] public Button submit = new Button(By.Css(“.btn”)); [FindBy(Css=“.btn”) ] public IButton submit;
  • 15. MULTILOCATORS 15 Multi language testing [JFindBy (text=“Submit”, group=“en”) ] [JFindBy (text=“Отправить” , group=“ru”) ] public Button submit; Multi version testing [JFindBy(text=“Submit”, group=“1.7”) ] [JFindBy(value=“Submit” , group=“2.0”) ] public Button submit;
  • 16. PLATO'S THEORY OF FORMS 5 No application but you can write UI Objects (Page Objects ) IButton
  • 18. COMPLEX ELEMENTS public Dropdown Colors; public Checklist Settings; public ComboBox Tags; public DropList ShirtSizes; public List<Element> SearchResults; public Elements Reviews; public Table Products; public Menu MainMenu; public Tabs Areas; public Selector Vote; public RadioButtons Rating; public TextList Chat; 18
  • 19. COMPLEX ELEMENTS [FindBy (Css = “.colors") ] public Dropdown colors = new Dropdown { Value = By.Css(".value"), List = By.TagName(“li") }; 19 [FindBy (Css = “.offers") ] public Table offers = new Table { Row = By.Css(".value"), Column = By.TagName(“li"), Header = new [] {“ID", “Title", “Apply”} };
  • 20. COMPLEX ELEMENTS [FindBy (Css = “.colors") ] public Dropdown Colors; [FindBy (Css = “.table”) ] public Table Offers; 20 [FindBy (Css = “.menu li”) ] public Menu Navigation; [FindBy (Css = “.menu ul”) ] public Menu Navigation; [FindBy (Xpath = “//*[@class=‘menu’]//li[text()=‘%s’]”) ] public Menu Navigation;
  • 21. • Code readability • Clear behavior • Union of all element’s locators • Union of element and its actions • Detailed logging TYPIFIED ELEMENTS 21
  • 22. Text Description; Button Submit; Label ProductName; Link FollowMe; TextField Password; TextArea Abuse; CheckBox RememberMe; DatePicker Date; FileInput Upload; Image Photo; IWebElement Description; IWebElement SubmitButton; IWebElement ProductName; IWebElement FollowMeLink; IWebElement PasswordField; IWebElement Abuse; IWebElement RememberMe; IWebElement DatePicker; IWebElement Upload; IWebElement Photo; COMPARE 22
  • 23. COMPARE [FindBy(css = “.colors") ] public Dropdown colors = new Dropdown { Value = By.Css(".value"), List = By.TagName(“li") }; [FindBy(Css = “.colors .value") ] IWebElement ColorsValue; [FindBy (Css = “.colors li") ] List<IWebElement> ColorsList; public string GetColor() { return ColorsValue.GetText(); } public void SelectColor(String ColorName) { ColorsValue.Click(); for (IWebElement Color : ColorsList) if (Color.getText().Equals(ColorName) { Color.Click(); return; } 23
  • 24. COMPARE [FindBy (Id = “trades") ] public Table Colors; [FindBy (Id = “…") ] private List<IWebElement> ResultsColHeaders; [FindBy (Id = “…") ] private List<IWebElement> ResultsRowsHeaders; [FindBy (Id = “…") ] private List<IWebElement> ResultsCellsHeaders; [FindBy (Id = “…") ] private List<IWebElement> ResultsColumn; [FindBy (Id = “…") ] private List<IWebElement> ResultsRow; ICell cell(Column column, Row row) { } ICell cell(String columnName, String rowName) { } ICell cell(int columnIndex, int rowIndex) { } List<ICell> cells(String value) { } List<ICell> cellsMatch(String regex) { } ICell cell(String value) { } ICell cellMatch(String regex) { } MapArray<String, MapArray<String, ICell>> rows(String... colNameValues) { } MapArray<String, MapArray<String, ICell>> columns(String... rowNameValues) { } boolean waitValue(String value, Row row) { } boolean waitValue(String value, Column column) { } boolean isEmpty() { } boolean waitHaveRows() { } boolean waitRows(int count) { } ICell cell(String value, Row row) { } ICell cell(String value, Column column) { } List<ICell> cellsMatch(String regex, Row row) { } List<ICell> cellsMatch(String regex, Column column) { } MapArray<String, ICell> row(String value, Column column) { } MapArray<String, ICell> column(String value, Row row) { } MapArray<String, ICell> row(int rowNum) { } MapArray<String, ICell> row(String rowName) { } List<String> rowValue(int colNum) { } List<String> rowValue(String colName) { } MapArray<String, ICell> column(int colNum) { } MapArray<String, ICell> column(String colName) { } List<String> columnValue(int colNum) { } List<String> columnValue(String colName) { } MapArray<String, SelectElement> header() { } SelectElement header(String name) { } List<String> headers() { } List<String> footer() { } List<ICell> getCells() { } void clean() { } void clear() { } ITable useCache(boolean value) { } ITable useCache() { } Table clone() { } Table copy() { } ITable hasAllHeaders() { } ITable hasNoHeaders() { } ITable hasOnlyColumnHeaders() { } ITable hasOnlyRowHeaders() { } ITable hasColumnHeaders(List<String> value) { } <THeaders extends Enum> ITable hasColumnHeaders(Class<THeaders> headers) { } ITable hasRowHeaders(List<String> value) { } <THeaders extends Enum> ITable hasRowHeaders(Class<THeaders> headers) { } ITable setColumnsCount(int value) { } ITable setRowsCount(int value) { } 24
  • 26. public class Header : Section [JPage (Url = "/index.html", Title = “Good site") ] public class HomePage : WebPage [JSite (Domain = “http://epam.com/") ] public class EpamSite : WebSite public class LoginForm : Form public class SearchBar : Search public class Alert : Popup public class Navigation : Pagination 26 COMPOSITE ELEMENTS
  • 27. [JPage (domain = “http://epam.com/") ] public class EpamSite : WebSite { [JPage (Url = "/index.html") ] public static HomePage homepage; [JPage (Url = "/login", Title = “Login page") ] public static LoginPage loginPage; [FindBy (Сss=“.nav”) ] public static Menu navigation; } 27 WEB SITE public static void SetUp() { WebSite.Init(typeof(EpamSite)); }
  • 28. [JPage (Url = "/main", Title = "Good site", UrlTemplate = “/main?d{10}“, UrlCheckType = MATCH, TitleCheckType = CONTAINS) ] public class HomePage : WebPage 28 WEB PAGE homepage.Open(); homepage.CheckOpened(); homepage.IsOpened(); homepage.Refresh(); homepage.Back(); homepage.Forward(); homepage.AddCookie(); homepage.ClearCache(); USAGE
  • 29. public class Header : Section { [FindBy (Сss=“.submit”) ] public Button submit; [FindBy (Сss=“.followMe”) ] public Link followMe; [FindBy (Сss=“.navigation”) ] public Menu navigation; public void openAbout() { followMe.Click(); navigation.Select(ABOUT); } } 29 SECTION header.Submit.Click(); header.Menu.IsSelected(); header.OpenAbout(); USAGE
  • 31. EDT: DATA DRIVEN TESTING 31  Provide List<User> for test
  • 32. EDT: PRECONDITIONS 32  Provide List<User> for test 0. Have DefaultUser in DB
  • 33. EDT: FILL AND SUBMIT 33  Provide List<User> for test 0. Have DefaultUser in DB 1. Login with DefaultUser
  • 34. EDT: FILL AND SEND 34  Provide List<User> for test 0. Have DefaultUser in DB 1. Login with DefaultUser 2. Submit Contact Us Form for DefaultUser
  • 35. EDT: EXTRACT 35  Provide List<User> for test 0. Have DefaultUser in DB 1. Login with DefaultUser 2. Submit Contact Us Form for DefaultUser 3. Get Act. Opening from Vacancy table
  • 36. EDT: VALIDATE 36  Provide List<User> for test 0. Have DefaultUser in DB 1. Login with DefaultUser 2. Submit Contact Us Form for DefaultUser 3. Get Act. Opening from Vacancy table 4. Assert Act. Opening equals to Exp. Opening ExpectedActual
  • 37. public class LoginForm extends Form<User> { [FindBy (Сss=“.login”) public TextField Login; [FindBy (Сss=“.psw”) public TextField Password; [FindBy (Сss=“.submit”) public Button Submit; [FindBy (Сss=“.cancel”) public Button Cancel; } 37 FORM public class User { public String Login = “roman”; public String Password = null; } [Test] public class SimpleTest(User User) { loginForm.login(user); … }
  • 38. [Test] public void FormTest(User Admin) { LoginForm.LoginAs(Admin); Filter.Select(Admin.name); Assert.Each(Results).Contains(Admin.Name); Results.get(1); PayForm.Submit(Admin.CreditCard); Assert.AreEquals(DB.Transactions[1]), Admin.CreditCard); } 38 ENTITY DRIVEN TESTING LoginForm.Fill(User); LoginForm.Submit(User); LoginForm.Verify(User); LoginForm.Check(User); LoginForm.Cancel(User); LoginForm.Save(User); LoginForm.Publish(User); LoginForm.Search(User); LoginForm.Update(User); … USAGE
  • 39. [FindBy (Css = “.offers") ] public Table<Job, JobRecord> Offers = new Table { Row = By.Css(".value"), Column = By.TagName(“li"), Header = new [] {“ID", “Title", “Apply”} }; 39
  • 40. [FindBy (Css = ".list.ui-sortable") ] public Elements<FilmCard> FilmCards; FilmCards[name].Title.GetText(); 40 ELEMENTS
  • 41. 41 OTHER UI OBJECTS public class SearchBar : Search { } public class Navigation : Pagination { } public class Confirmation : Popup { } … public class MyCustom : CustomObject { } // implements IComposite
  • 48. 48 TEST ANY UI Your Engine (Driver)
  • 49. 49 JDI ARCHITECTURE Commons Core Matchers Web, Mobile, Gui … public interface ICheckBox extends IClickable, ISetValue { void Check(); void Uncheck(); boolean IsChecked(); } INTERFACES IElement ISelector IComposite IPage IHasValue ISetValue IButton ICheckBox IDatePicker IFileInput IImage ILabel ILink IText ITextArea ITextField ICheckList IComboBox IDropDown IDropList IForm IGroup IMenu IPage IPagination IPopup IRadioButtons ISearch ISelector ITabs ITextList
  • 51. • Write test code faster up to 5 times • Average result around 2.8 times • 4.7 times speedup on the project with standard implementation • Produce less amount of test code (loc) up to 3 times • Average result around 2.1 times • 2.8 times reduction on the project with standard implementation • Achieve higher clearness of tests • Decrease of support time for test projects • Lowering of project entry barrier for newcomers • Complete projects with higher quality • Based on 70 % answers in survey 51 JDI BENEFITS
  • 52. • Reuse investments from one Project on another • Based on 5 years of work and more than 30 projects that already use JDI • Save up to 80% test effort by migrating tests to other Platforms • Based estimated average scope reductions for all test process stages • Example: migrate Web tests to Mobile platform • Can be used in most of projects with UI Automation • Actually we have no projects where JDI is not applicable. The only reason why not all of our projects use JDI is Client requirements • Save up to 30-40% money from whole test process • Based on average calculation of scope reductions for all test process stages 52 JDI BENEFITS
  • 54. LOG IN BDD STYLE I select ‘jacket’ ProductType on ProductPage I select ‘500$’ Price on ProductPage I check ‘black’ and ‘white’ Colors on ProductPage 54 ProductPage.ProductType.select(«jacket»); ProductPage.Price.select(«500$»); ProductPage.Colors.check(«black», «white»);
  • 55. • Chrome plugin • Get ui elements to page object in browser • Auto generation 55 GENERATED PAGE OBJECTS public class LoginForm extends Form<User> { @FindBy (css=“.login”) public TextField login; @FindBy (css=“.psw”) public TextField password; @FindBy (css=“.submit”) public Button login; }
  • 56. 56 SERVICES PAGE OBJECTS @ServiceDomain(“http://service.com”) public class ServiceExample { @GET (“/color/get”) public RestMethod getColor; @POST (“/color/change/100”) public RestMethod changeColor; } Auto generation by WSDL
  • 59. 59 SUPPORT MAIN UI DEV FRAMEWORKS
  • 62. 62 SUPPORT JS / PHYTON

Editor's Notes

  • #3: Работаю в компании Epam в
  • #17: Why we develop it? Some people formulate it as “Why you create one more wheel”