SlideShare ist ein Scribd-Unternehmen logo
1 von 64
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

Weitere ähnliche Inhalte

Was ist angesagt?

Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
Jussi Pohjolainen
 
jQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20PresentationjQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20Presentation
guestcf600a
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
 
Beginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_bBeginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_b
Jihoon Kong
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
Simon Willison
 

Was ist angesagt? (17)

Dollar symbol
Dollar symbolDollar symbol
Dollar symbol
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
Laravel 로 배우는 서버사이드 #5
Laravel 로 배우는 서버사이드 #5Laravel 로 배우는 서버사이드 #5
Laravel 로 배우는 서버사이드 #5
 
jQuery Basic API
jQuery Basic APIjQuery Basic API
jQuery Basic API
 
jQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20PresentationjQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20Presentation
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Beginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_bBeginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_b
 
JQuery
JQueryJQuery
JQuery
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
Jquery 3
Jquery 3Jquery 3
Jquery 3
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Crowdsourcing with Django
Crowdsourcing with DjangoCrowdsourcing with Django
Crowdsourcing with Django
 

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

EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
Heiko Behrens
 

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

EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
 
MVVM with SwiftUI and Combine
MVVM with SwiftUI and CombineMVVM with SwiftUI and Combine
MVVM with SwiftUI and Combine
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииМощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
 
Revolution or Evolution in Page Object
Revolution or Evolution in Page ObjectRevolution or Evolution in Page Object
Revolution or Evolution in Page Object
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobile
 
Action bar
Action barAction bar
Action bar
 
IN4308 Lecture 3
IN4308 Lecture 3IN4308 Lecture 3
IN4308 Lecture 3
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 
Android Design Patterns
Android Design PatternsAndroid Design Patterns
Android Design Patterns
 
Beautiful java script
Beautiful java scriptBeautiful java script
Beautiful java script
 
APPlause - DemoCamp Munich
APPlause - DemoCamp MunichAPPlause - DemoCamp Munich
APPlause - DemoCamp Munich
 
UIWebView Tips
UIWebView TipsUIWebView Tips
UIWebView Tips
 
Web Development Course - JQuery by RSOLUTIONS
Web Development Course - JQuery by RSOLUTIONSWeb Development Course - JQuery by RSOLUTIONS
Web Development Course - JQuery by RSOLUTIONS
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
Iniciando com jquery
Iniciando com jqueryIniciando com jquery
Iniciando com jquery
 
Aplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com BackboneAplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com Backbone
 
Geb qa fest2017
Geb qa fest2017Geb qa fest2017
Geb qa fest2017
 

Mehr von SpbDotNet Community

Mehr von SpbDotNet Community (20)

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

Kürzlich hochgeladen

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 

Роман Иовлев «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

Hinweis der Redaktion

  1. Работаю в компании Epam в
  2. Why we develop it? Some people formulate it as “Why you create one more wheel”