SlideShare a Scribd company logo
1 of 72
Escape from
the automation hell
How WebDriver works?
Unreadable Selenium tests
DSL
A domain-specific language (DSL) is a computer
language specialized to a particular application domain.
@Test
public void bookShouldBeSearchedByName() {
loginToBookStoreAs(regularUser);
openBookStorePage();
enterSearchCriteria("99 Francs");
searchBooks();
assertFalse(isEmptySearchResult());
}
Benefits of DSL Approach
● High-level - tests are in the language of product
management, at the user level
● Readable - product management can understand them
● Writable - easy for developer or QA to write new test
● Extensible - tests base is able to grow with DSL
Tips and Tricks of DSL Approach
● Use test class hierarchy or test helpers
● Use builders, visitors and other design patterns
● Reuse domain model from application
● Some common methods move to base test class
● Minimize usage of driver instance in tests
What is really Test Automation Framework?
Test Automation Framework (TAF) — the environment required for test
automation including test harnesses and artifacts such as test libraries.
Test Automation Solution (TAS) — the realization / implementation of a TAA
including test harnesses and artifacts such as test libraries.
Test Automation Architecture (TAA) — an instantiation of gTAA to define the
architecture of a TAS.
Generic Test Automation Architecture (gTAA) — providing a blueprint for test
automation solutions.
What is really Test Automation Framework?
What is Test Automation Engineer?
Test Automation Engineer (TAE) — the person who is
responsible for the design of a Test Automation Architecture
(TAA), including the implementation of the resulting Test
Automation Solution (TAS), its maintenance and technical
evolution.
TAE == Software Developer in Test
What is really WebDriver?
Selenium is
a suite of tools to automate web browsers
across many platforms.
What is really WebDriver?
Selenium automates browsers. That's it!
UI Test Automation Framework
Selenium inside
http://selenide.org
https://github.com/codeborne/selenide
Selenide > Main Goals
KISS principle in action
No unnecessary code → No unnecessary maintenance
Less to learn → Easier to use
Selenide > Keynote
Create a browser
Selenium WebDriver:
DesiredCapabilities desiredCapabilities = DesiredCapabilities.htmlUnit();
desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDSELECTIONERROR, true);
desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDXPATHERROR, false);
desiredCapabilities.setJavascriptEnabled(true);
WebDriver driver = new HtmlUnitDriver(desiredCapabilities);
Selenide:
open("https://catalog.onliner.by");
Selenide > Keynote
Shutdown a browser
Selenium WebDriver:
if (driver != null) {
driver.close();
}
Selenide:
// Do not care! Selenide closes the browser automatically
With Selenide You don't need to operate with Selenium WebDriver directly.
WebDriver will be automatically created/deleted during test start/finished.
Selenide > Keynote
Find element by id
Selenium WebDriver:
WebElement customer = driver.findElement(By.id("customerContainer"));
Selenide:
WebElement customer = $("#customerContainer");
or a longer conservative option:
WebElement customer = $(By.id("customerContainer"));
Selenide > Keynote
Assert that element has a correct text
Selenium WebDriver:
assertEquals("Customer profile",
driver.findElement(By.id("customerContainer")).getText());
Selenide:
$("#customerContainer").shouldHave(text("Customer profile"));
Selenide > Keynote
Ajax support (waiting for some event to happen)
Selenium WebDriver:
FluentWait<By> fluentWait = new FluentWait<By>(By.tagName("TEXTAREA"));
fluentWait.pollingEvery(100, TimeUnit.MILLISECONDS);
fluentWait.withTimeout(1000, TimeUnit.MILLISECONDS);
fluentWait.until(new Predicate<By>() {
public boolean apply(By by) {
try {
return browser.findElement(by).isDisplayed();
} catch (NoSuchElementException ex) {
return false;
}
}
});
assertEquals("John", browser.findElement(By.tagName("TEXTAREA")).getAttribute("value"));
Selenide:
$("TEXTAREA").shouldHave(value("John"));
This command automatically waits until element gets visible AND gets expected value.
Default timeout is 4 seconds and it's configurable.
Selenide > Keynote
Assert that element does not exist
Selenium WebDriver:
try {
WebElement element = driver.findElement(By.id("customerContainer"));
fail("Element should not exist: " + element);
}
catch (WebDriverException itsOk) {}
Selenide:
$("#customerContainer").shouldNot(exist);
Selenide > Keynote
Looking for element inside parent element
Selenium WebDriver:
WebElement parent = driver.findElement(By.id("customerContainer"));
WebElement element = parent.findElement(By.className("user_name"));
Selenide:
$("#customerContainer").find(".user_name");
Selenide > Keynote
Looking for Nth element
Selenium WebDriver:
driver.findElements(By.tagName("li")).get(5);
Selenide:
$("li", 5);
Selenide > Keynote
Select a radio button
Selenium WebDriver:
for (WebElement radio : driver.findElements(By.name("sex"))) {
if ("woman".equals(radio.getAttribute("value"))) {
radio.click();
}
}
throw new NoSuchElementException("'sex' radio field has no value 'woman'");
Selenide:
selectRadio(By.name("sex"), "woman");
Selenide > Keynote
Take a screenshot
Selenium WebDriver:
if (driver instanceof TakesScreenshot) {
File scrFile = ((TakesScreenshot) webdriver)
.getScreenshotAs(OutputType.FILE);
File targetFile = new File("c:temp" + fileName + ".png");
FileUtils.copyFile(scrFile, targetFile);
}
Selenide:
takeScreenShot("my-test-case");
Selenide > Three simple things
1. Open the page
2. $(element).doAction()
3. $(element).check(condition)
open("/login");
$("#submit").click();
$(".message").shouldHave(text("Hello"));
Selenide > Use the power of IDE
Selenide API consists of few classes. Open your IDE and start typing.
Just type: $(selector). - and IDE will suggest you all available options.
Use the power of todays development environments instead of bothering with
documentation!
Selenide > Selenide API
open(String URL) opens the browser (if yet not opened) and loads the
URL
$(String cssSelector) – returns object of the SelenideElement class that
represents first element found by CSS selector on the page.
$(By) – returns "first SelenideElement" by the locator of the By class.
$$(String cssSelector) – returns object of type ElementsCollection that
represents collection of all elements found by a CSS selector.
$$(By) – returns "collection of elements" by the locator of By type.
import static com.codeborne.selenide.Selenide.* for readability
Selenide > Selenide API > Selectors
com.codeborne.selenide.Selectors
$(byText("Login")).shouldBe(visible));
$(byXpath("//div[text()='Login']")).shouldBe(visible);
$(By.xpath("//div[text()='Login']")).shouldBe(visible);
Selector
byText - search element by exact text
withText - search element by contained text (substring)
by(attributeName, attributeValue) - search by attribute’s name and value
byTitle - search by attribute “title”
byValue - search by attribute “value”
Xpath
etc.
Selenide > Selenide API
Perform some action on it:
$(byText("Sign in")).click();
Or even several actions at once:
$(byName("password")).setValue("qwerty").pressEnter();
Check some condition:
$(".welcome-message").shouldHave(text("Welcome, user!"));
When you needed an element in Element Collection of a same type:
$$("#search-results a").findBy(text("selenide.org")).click();
Selenide > Selenide API > Selenide Elements
Selenide Elements
SelenideElement
ElementsCollection
$ $$
Selenide > Selenide API > Selenide Element
com.codeborne.selenide.SelenideElement
Actions methods
Search methods
Element statuses methods
Check methods (Assertions)
Conditions methods
Selenide Explicit Waits methods
Other useful methods
Selenide > Selenide API > Selenide Element
Actions methods
click()
doubleClick()
contextClick()
hover()
setValue(String) / val(String)
pressEnter()
pressEscape()
pressTab()
selectRadio(String value)
selectOption(String)
dragAndDropTo(String)
…
Search methods
find(String cssSelector)
/ $(String cssSelector)
find(By) / $(By)
findAll(String cssSelector)
/ $$(String cssSelector)
findAll(By) / $$(By)
Selenide > Selenide API > Selenide Element
Element statuses methods
getValue() / val()
data()
attr(String)
text()
innerText()
getSelectedOption()
getSelectedText()
getSelectedValue()
isDisplayed()
exists()
...
Check methods (Assertions)
should(Condition)
shouldBe(Condition)
shouldHave(Condition)
shouldNot(Condition)
shouldNotBe(Condition)
shouldNotHave(Condition)
Selenide > Selenide API > Selenide Element
Selenide Explicit Waits methods
waitUntil(Condition,
milliseconds)
waitWhile(Condition,
milliseconds)
Other useful methods
uploadFromClasspath(String
fileName)
download()
toWebElement()
uploadFile(File…)
Selenide > Selenide API > Selenide Element
com.codeborne.selenide.SelenideElement
Actions methods
Search methods
Element statuses methods
Check methods (Assertions)
Conditions methods
Selenide Explicit Waits methods
Other useful methods
● visible / appear
● present / exist
● hidden / disappear
● readonly
● name
● value
● type
● id
● empty
Selenide > Selenide API > Selenide Element
com.codeborne.selenide.Condition
$("input").shouldHave(exactText("Some text"));
Condition
● attribute(name)
● attribute(name, value)
● cssClass(String)
● focused
● enabled
● disabled
● selected
● matchText(String regex)
● text(String substring)
● exactText(String wholeText)
● textCaseSensitive(String substring)
● exactTextCaseSensitive(String wholeText)
Selenide > Selenide API > Selenide Elements
Selenide Elements
SelenideElement
ElementsCollection
$ $$
com.codeborne.selenide.ElementsCollection
Selector methods
Element statuses methods
Check methods (Assertions)
Conditions methods
Selenide > Selenide API > Elements Collection
Selenide > Selenide API > Elements Collection
Selector methods
filterBy(Condition) – returns
collection with only those
original collection elements
that satisfies the condition,
excludeWith(Condition)
get(int)
findBy(Condition)
Element statuses methods
size()
isEmpty()
getTexts()
Selenide > Selenide API > Elements Collection
Check methods (Assertions)
shouldBe(CollectionCondition)
shouldHave(CollectionCondition)
Assertions also play role of explicit waits.
They wait for condition
(e.g. size(2), empty, texts("a", "b", "c")) to be
satisfied until timeout reached (the value
of Configuration.collectionsTimeout
that is set to 6000 ms by default).
Conditions methods
empty
size(int)
sizeGreaterThan(int)
sizeGreaterThanOrEqual(int)
sizeLessThan(int)
sizeLessThanOrEqual(int)
sizeNotEqual(int)
texts(String... substrings)
exactTexts(String... wholeTexts)
Selenide > Selenide API > WebDriver Runner
com.codeborne.selenide.WebDriverRunner
This class defines some browser management methods:
isChrome()
isFirefox()
isHeadless()
url()
source()
getWebDriver() - returns the WebDriver instance (created by Selenide
automatically or set up by the user), thus giving to the user the raw API
to Selenium if needed
setWebDriver(WebDriver) - tells Selenide to use driver created by the
user. From this moment the user himself is responsible for closing the
driver.
Selenide > Selenide API > Configuration
com.codeborne.selenide.Configuration
Сonfiguration options to configure execution of Selenide-based tests, e.g.:
timeout: waiting timeout in milliseconds, that is used in explicit
(should/shouldNot/waitUntil/waitWhile) and implicit waiting for
SelenideElement; set to 4000 ms by default; can be changed for
specific tests, e.g. Configuration.timeout = 6000;
collectionsTimeout - waiting timeout in milliseconds, that is used in
explicit (should/shouldNot/waitUntil/waitWhile) and implicit waiting for
ElementsCollection; set to 6000 ms by default; can be changed for
specific tests, e.g. Configuration.collectionsTimeout = 8000;
browser (e.g. "chrome", "ie", "firefox")
baseUrl
...
UI Test Automation Framework
Selenium inside
http://jdi.epam.com
https://github.com/epam/JDI
https://github.com/epam/JDI-Examples
JDI > Main Goals
Already implemented actions for most used elements
Detailed UI actions log
Flexible for any UI on any Framework or Platform
Short and obvious UI Objects (Page Objects)
JDI > Simple Test
loginPage.open();
loginPage.loginForm.login(admin);
searchPage.search.find("Cup");
Assert.AreEqual(
resultsPage.products.count(),
expected);
JDI > Simple Test
productPage.productType.Select("jacket");
productPage.price.select("500$");
productPage.colors.check("black", "white");
Assert.isTrue(
productPage.label.getText(),
"Massimo Dutti Jacket")
JDI > JDI API
Elements
Simple
Complex
Composite
JDI > JDI API
Simple Elements
JDI > JDI API > Simple Elements
JDI > JDI API > Simple Elements
JDI > JDI API > Multilocators
JDI > JDI API
Complex Elements
JDI > JDI API > Complex Elements
JDI > JDI API > Complex Elements
JDI > JDI API > Complex Elements
JDI > JDI API > Complex Elements > Enums
JDI > JDI API > Typified elements
Code readability
Clear behavior
Union of all element’s locators
Union of element and its actions
Detailed logging
JDI > JDI API > Compare
JDI > JDI API > Compare
JDI > JDI API
Composite Elements
JDI > JDI API > Composite Elements
JDI > JDI API > Web Site
JDI > JDI API > Web Page
JDI > JDI API > Section
JDI
UI Objects Pattern
JDI > UI Objects Pattern
JDI > UI Objects Pattern
JDI
Interfaces
JDI > Test Any UI
JDI > Architecture
JDI > Interfaces
JDI
Selenide vs JDI > Language support
Native JNI Selene
Native Native
Not
supported

More Related Content

What's hot

Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
XpDays - Automated testing of responsive design (GalenFramework)
XpDays - Automated testing of responsive design (GalenFramework)XpDays - Automated testing of responsive design (GalenFramework)
XpDays - Automated testing of responsive design (GalenFramework)Alex Fruzenshtein
 
Introduction to Sightly
Introduction to SightlyIntroduction to Sightly
Introduction to SightlyAnkit Gubrani
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Iakiv Kramarenko
 
Galen Framework - Responsive Design Automation
Galen Framework - Responsive Design AutomationGalen Framework - Responsive Design Automation
Galen Framework - Responsive Design AutomationVenkat Ramana Reddy Parine
 
Breaking the limits_of_page_objects
Breaking the limits_of_page_objectsBreaking the limits_of_page_objects
Breaking the limits_of_page_objectsRobert Bossek
 
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardJAX London
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnetVlad Maniak
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object patternMichael Palotas
 
Selenium locators: ID, Name, xpath, CSS Selector advance methods
Selenium locators: ID, Name,  xpath, CSS Selector advance methodsSelenium locators: ID, Name,  xpath, CSS Selector advance methods
Selenium locators: ID, Name, xpath, CSS Selector advance methodsPankaj Dubey
 
Scaladays 2014 introduction to scalatest selenium dsl
Scaladays 2014   introduction to scalatest selenium dslScaladays 2014   introduction to scalatest selenium dsl
Scaladays 2014 introduction to scalatest selenium dslMatthew Farwell
 
Webdriver cheatsheets summary
Webdriver cheatsheets summaryWebdriver cheatsheets summary
Webdriver cheatsheets summaryAlan Richardson
 
AtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlassian
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Iakiv Kramarenko
 
AtlasCamp 2015: Connect everywhere - Cloud and Server
AtlasCamp 2015: Connect everywhere - Cloud and ServerAtlasCamp 2015: Connect everywhere - Cloud and Server
AtlasCamp 2015: Connect everywhere - Cloud and ServerAtlassian
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsLudmila Nesvitiy
 

What's hot (19)

Spring batch
Spring batchSpring batch
Spring batch
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
XpDays - Automated testing of responsive design (GalenFramework)
XpDays - Automated testing of responsive design (GalenFramework)XpDays - Automated testing of responsive design (GalenFramework)
XpDays - Automated testing of responsive design (GalenFramework)
 
Introduction to Sightly
Introduction to SightlyIntroduction to Sightly
Introduction to Sightly
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
 
Galen Framework - Responsive Design Automation
Galen Framework - Responsive Design AutomationGalen Framework - Responsive Design Automation
Galen Framework - Responsive Design Automation
 
Breaking the limits_of_page_objects
Breaking the limits_of_page_objectsBreaking the limits_of_page_objects
Breaking the limits_of_page_objects
 
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted Neward
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object pattern
 
Selenium locators: ID, Name, xpath, CSS Selector advance methods
Selenium locators: ID, Name,  xpath, CSS Selector advance methodsSelenium locators: ID, Name,  xpath, CSS Selector advance methods
Selenium locators: ID, Name, xpath, CSS Selector advance methods
 
Scaladays 2014 introduction to scalatest selenium dsl
Scaladays 2014   introduction to scalatest selenium dslScaladays 2014   introduction to scalatest selenium dsl
Scaladays 2014 introduction to scalatest selenium dsl
 
Webdriver cheatsheets summary
Webdriver cheatsheets summaryWebdriver cheatsheets summary
Webdriver cheatsheets summary
 
AtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using now
 
Easy automation.py
Easy automation.pyEasy automation.py
Easy automation.py
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
 
AtlasCamp 2015: Connect everywhere - Cloud and Server
AtlasCamp 2015: Connect everywhere - Cloud and ServerAtlasCamp 2015: Connect everywhere - Cloud and Server
AtlasCamp 2015: Connect everywhere - Cloud and Server
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 

Similar to Escape from the automation hell

2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6Marakana Inc.
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Selenide review and how to start using it in legacy Selenium tests
Selenide review and how to start using it in legacy Selenium testsSelenide review and how to start using it in legacy Selenium tests
Selenide review and how to start using it in legacy Selenium testsProvectus
 
Component Based Unit Testing ADF with Selenium
Component Based Unit Testing ADF with SeleniumComponent Based Unit Testing ADF with Selenium
Component Based Unit Testing ADF with SeleniumRichard Olrichs
 
Test automation with selenide
Test automation with selenideTest automation with selenide
Test automation with selenideIsuru Madanayaka
 
Selenium testing
Selenium testingSelenium testing
Selenium testingJason Myers
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instrumentsArtem Nagornyi
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Puneet Kala
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
Better Testing With PHP Unit
Better Testing With PHP UnitBetter Testing With PHP Unit
Better Testing With PHP Unitsitecrafting
 
Selenium
SeleniumSelenium
Seleniumeduquer
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsQuontra Solutions
 

Similar to Escape from the automation hell (20)

2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Selenide review and how to start using it in legacy Selenium tests
Selenide review and how to start using it in legacy Selenium testsSelenide review and how to start using it in legacy Selenium tests
Selenide review and how to start using it in legacy Selenium tests
 
Component Based Unit Testing ADF with Selenium
Component Based Unit Testing ADF with SeleniumComponent Based Unit Testing ADF with Selenium
Component Based Unit Testing ADF with Selenium
 
Automated Testing ADF with Selenium
Automated Testing ADF with SeleniumAutomated Testing ADF with Selenium
Automated Testing ADF with Selenium
 
Web driver training
Web driver trainingWeb driver training
Web driver training
 
Test automation with selenide
Test automation with selenideTest automation with selenide
Test automation with selenide
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Selenium testing
Selenium testingSelenium testing
Selenium testing
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
 
Selenium
SeleniumSelenium
Selenium
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Better Testing With PHP Unit
Better Testing With PHP UnitBetter Testing With PHP Unit
Better Testing With PHP Unit
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Selenium with java
Selenium with javaSelenium with java
Selenium with java
 
Selenium
SeleniumSelenium
Selenium
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
 
Selenium
SeleniumSelenium
Selenium
 
Automated testing by Richard Olrichs and Wilfred vd Deijl
Automated testing by Richard Olrichs and Wilfred vd DeijlAutomated testing by Richard Olrichs and Wilfred vd Deijl
Automated testing by Richard Olrichs and Wilfred vd Deijl
 

Recently uploaded

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
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...SelfMade bd
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
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.pptxalwaysnagaraju26
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 

Recently uploaded (20)

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
 
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...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
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
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 

Escape from the automation hell

  • 4. DSL A domain-specific language (DSL) is a computer language specialized to a particular application domain. @Test public void bookShouldBeSearchedByName() { loginToBookStoreAs(regularUser); openBookStorePage(); enterSearchCriteria("99 Francs"); searchBooks(); assertFalse(isEmptySearchResult()); }
  • 5. Benefits of DSL Approach ● High-level - tests are in the language of product management, at the user level ● Readable - product management can understand them ● Writable - easy for developer or QA to write new test ● Extensible - tests base is able to grow with DSL
  • 6. Tips and Tricks of DSL Approach ● Use test class hierarchy or test helpers ● Use builders, visitors and other design patterns ● Reuse domain model from application ● Some common methods move to base test class ● Minimize usage of driver instance in tests
  • 7. What is really Test Automation Framework? Test Automation Framework (TAF) — the environment required for test automation including test harnesses and artifacts such as test libraries. Test Automation Solution (TAS) — the realization / implementation of a TAA including test harnesses and artifacts such as test libraries. Test Automation Architecture (TAA) — an instantiation of gTAA to define the architecture of a TAS. Generic Test Automation Architecture (gTAA) — providing a blueprint for test automation solutions.
  • 8. What is really Test Automation Framework?
  • 9. What is Test Automation Engineer? Test Automation Engineer (TAE) — the person who is responsible for the design of a Test Automation Architecture (TAA), including the implementation of the resulting Test Automation Solution (TAS), its maintenance and technical evolution. TAE == Software Developer in Test
  • 10. What is really WebDriver? Selenium is a suite of tools to automate web browsers across many platforms.
  • 11. What is really WebDriver? Selenium automates browsers. That's it!
  • 12. UI Test Automation Framework Selenium inside http://selenide.org https://github.com/codeborne/selenide
  • 13. Selenide > Main Goals KISS principle in action No unnecessary code → No unnecessary maintenance Less to learn → Easier to use
  • 14. Selenide > Keynote Create a browser Selenium WebDriver: DesiredCapabilities desiredCapabilities = DesiredCapabilities.htmlUnit(); desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDSELECTIONERROR, true); desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDXPATHERROR, false); desiredCapabilities.setJavascriptEnabled(true); WebDriver driver = new HtmlUnitDriver(desiredCapabilities); Selenide: open("https://catalog.onliner.by");
  • 15. Selenide > Keynote Shutdown a browser Selenium WebDriver: if (driver != null) { driver.close(); } Selenide: // Do not care! Selenide closes the browser automatically With Selenide You don't need to operate with Selenium WebDriver directly. WebDriver will be automatically created/deleted during test start/finished.
  • 16. Selenide > Keynote Find element by id Selenium WebDriver: WebElement customer = driver.findElement(By.id("customerContainer")); Selenide: WebElement customer = $("#customerContainer"); or a longer conservative option: WebElement customer = $(By.id("customerContainer"));
  • 17. Selenide > Keynote Assert that element has a correct text Selenium WebDriver: assertEquals("Customer profile", driver.findElement(By.id("customerContainer")).getText()); Selenide: $("#customerContainer").shouldHave(text("Customer profile"));
  • 18. Selenide > Keynote Ajax support (waiting for some event to happen) Selenium WebDriver: FluentWait<By> fluentWait = new FluentWait<By>(By.tagName("TEXTAREA")); fluentWait.pollingEvery(100, TimeUnit.MILLISECONDS); fluentWait.withTimeout(1000, TimeUnit.MILLISECONDS); fluentWait.until(new Predicate<By>() { public boolean apply(By by) { try { return browser.findElement(by).isDisplayed(); } catch (NoSuchElementException ex) { return false; } } }); assertEquals("John", browser.findElement(By.tagName("TEXTAREA")).getAttribute("value")); Selenide: $("TEXTAREA").shouldHave(value("John")); This command automatically waits until element gets visible AND gets expected value. Default timeout is 4 seconds and it's configurable.
  • 19. Selenide > Keynote Assert that element does not exist Selenium WebDriver: try { WebElement element = driver.findElement(By.id("customerContainer")); fail("Element should not exist: " + element); } catch (WebDriverException itsOk) {} Selenide: $("#customerContainer").shouldNot(exist);
  • 20. Selenide > Keynote Looking for element inside parent element Selenium WebDriver: WebElement parent = driver.findElement(By.id("customerContainer")); WebElement element = parent.findElement(By.className("user_name")); Selenide: $("#customerContainer").find(".user_name");
  • 21. Selenide > Keynote Looking for Nth element Selenium WebDriver: driver.findElements(By.tagName("li")).get(5); Selenide: $("li", 5);
  • 22. Selenide > Keynote Select a radio button Selenium WebDriver: for (WebElement radio : driver.findElements(By.name("sex"))) { if ("woman".equals(radio.getAttribute("value"))) { radio.click(); } } throw new NoSuchElementException("'sex' radio field has no value 'woman'"); Selenide: selectRadio(By.name("sex"), "woman");
  • 23. Selenide > Keynote Take a screenshot Selenium WebDriver: if (driver instanceof TakesScreenshot) { File scrFile = ((TakesScreenshot) webdriver) .getScreenshotAs(OutputType.FILE); File targetFile = new File("c:temp" + fileName + ".png"); FileUtils.copyFile(scrFile, targetFile); } Selenide: takeScreenShot("my-test-case");
  • 24. Selenide > Three simple things 1. Open the page 2. $(element).doAction() 3. $(element).check(condition) open("/login"); $("#submit").click(); $(".message").shouldHave(text("Hello"));
  • 25. Selenide > Use the power of IDE Selenide API consists of few classes. Open your IDE and start typing. Just type: $(selector). - and IDE will suggest you all available options. Use the power of todays development environments instead of bothering with documentation!
  • 26. Selenide > Selenide API open(String URL) opens the browser (if yet not opened) and loads the URL $(String cssSelector) – returns object of the SelenideElement class that represents first element found by CSS selector on the page. $(By) – returns "first SelenideElement" by the locator of the By class. $$(String cssSelector) – returns object of type ElementsCollection that represents collection of all elements found by a CSS selector. $$(By) – returns "collection of elements" by the locator of By type. import static com.codeborne.selenide.Selenide.* for readability
  • 27. Selenide > Selenide API > Selectors com.codeborne.selenide.Selectors $(byText("Login")).shouldBe(visible)); $(byXpath("//div[text()='Login']")).shouldBe(visible); $(By.xpath("//div[text()='Login']")).shouldBe(visible); Selector byText - search element by exact text withText - search element by contained text (substring) by(attributeName, attributeValue) - search by attribute’s name and value byTitle - search by attribute “title” byValue - search by attribute “value” Xpath etc.
  • 28. Selenide > Selenide API Perform some action on it: $(byText("Sign in")).click(); Or even several actions at once: $(byName("password")).setValue("qwerty").pressEnter(); Check some condition: $(".welcome-message").shouldHave(text("Welcome, user!")); When you needed an element in Element Collection of a same type: $$("#search-results a").findBy(text("selenide.org")).click();
  • 29. Selenide > Selenide API > Selenide Elements Selenide Elements SelenideElement ElementsCollection $ $$
  • 30. Selenide > Selenide API > Selenide Element com.codeborne.selenide.SelenideElement Actions methods Search methods Element statuses methods Check methods (Assertions) Conditions methods Selenide Explicit Waits methods Other useful methods
  • 31. Selenide > Selenide API > Selenide Element Actions methods click() doubleClick() contextClick() hover() setValue(String) / val(String) pressEnter() pressEscape() pressTab() selectRadio(String value) selectOption(String) dragAndDropTo(String) … Search methods find(String cssSelector) / $(String cssSelector) find(By) / $(By) findAll(String cssSelector) / $$(String cssSelector) findAll(By) / $$(By)
  • 32. Selenide > Selenide API > Selenide Element Element statuses methods getValue() / val() data() attr(String) text() innerText() getSelectedOption() getSelectedText() getSelectedValue() isDisplayed() exists() ... Check methods (Assertions) should(Condition) shouldBe(Condition) shouldHave(Condition) shouldNot(Condition) shouldNotBe(Condition) shouldNotHave(Condition)
  • 33. Selenide > Selenide API > Selenide Element Selenide Explicit Waits methods waitUntil(Condition, milliseconds) waitWhile(Condition, milliseconds) Other useful methods uploadFromClasspath(String fileName) download() toWebElement() uploadFile(File…)
  • 34. Selenide > Selenide API > Selenide Element com.codeborne.selenide.SelenideElement Actions methods Search methods Element statuses methods Check methods (Assertions) Conditions methods Selenide Explicit Waits methods Other useful methods
  • 35. ● visible / appear ● present / exist ● hidden / disappear ● readonly ● name ● value ● type ● id ● empty Selenide > Selenide API > Selenide Element com.codeborne.selenide.Condition $("input").shouldHave(exactText("Some text")); Condition ● attribute(name) ● attribute(name, value) ● cssClass(String) ● focused ● enabled ● disabled ● selected ● matchText(String regex) ● text(String substring) ● exactText(String wholeText) ● textCaseSensitive(String substring) ● exactTextCaseSensitive(String wholeText)
  • 36. Selenide > Selenide API > Selenide Elements Selenide Elements SelenideElement ElementsCollection $ $$
  • 37. com.codeborne.selenide.ElementsCollection Selector methods Element statuses methods Check methods (Assertions) Conditions methods Selenide > Selenide API > Elements Collection
  • 38. Selenide > Selenide API > Elements Collection Selector methods filterBy(Condition) – returns collection with only those original collection elements that satisfies the condition, excludeWith(Condition) get(int) findBy(Condition) Element statuses methods size() isEmpty() getTexts()
  • 39. Selenide > Selenide API > Elements Collection Check methods (Assertions) shouldBe(CollectionCondition) shouldHave(CollectionCondition) Assertions also play role of explicit waits. They wait for condition (e.g. size(2), empty, texts("a", "b", "c")) to be satisfied until timeout reached (the value of Configuration.collectionsTimeout that is set to 6000 ms by default). Conditions methods empty size(int) sizeGreaterThan(int) sizeGreaterThanOrEqual(int) sizeLessThan(int) sizeLessThanOrEqual(int) sizeNotEqual(int) texts(String... substrings) exactTexts(String... wholeTexts)
  • 40. Selenide > Selenide API > WebDriver Runner com.codeborne.selenide.WebDriverRunner This class defines some browser management methods: isChrome() isFirefox() isHeadless() url() source() getWebDriver() - returns the WebDriver instance (created by Selenide automatically or set up by the user), thus giving to the user the raw API to Selenium if needed setWebDriver(WebDriver) - tells Selenide to use driver created by the user. From this moment the user himself is responsible for closing the driver.
  • 41. Selenide > Selenide API > Configuration com.codeborne.selenide.Configuration Сonfiguration options to configure execution of Selenide-based tests, e.g.: timeout: waiting timeout in milliseconds, that is used in explicit (should/shouldNot/waitUntil/waitWhile) and implicit waiting for SelenideElement; set to 4000 ms by default; can be changed for specific tests, e.g. Configuration.timeout = 6000; collectionsTimeout - waiting timeout in milliseconds, that is used in explicit (should/shouldNot/waitUntil/waitWhile) and implicit waiting for ElementsCollection; set to 6000 ms by default; can be changed for specific tests, e.g. Configuration.collectionsTimeout = 8000; browser (e.g. "chrome", "ie", "firefox") baseUrl ...
  • 42. UI Test Automation Framework Selenium inside http://jdi.epam.com https://github.com/epam/JDI https://github.com/epam/JDI-Examples
  • 43. JDI > Main Goals Already implemented actions for most used elements Detailed UI actions log Flexible for any UI on any Framework or Platform Short and obvious UI Objects (Page Objects)
  • 44. JDI > Simple Test loginPage.open(); loginPage.loginForm.login(admin); searchPage.search.find("Cup"); Assert.AreEqual( resultsPage.products.count(), expected);
  • 45. JDI > Simple Test productPage.productType.Select("jacket"); productPage.price.select("500$"); productPage.colors.check("black", "white"); Assert.isTrue( productPage.label.getText(), "Massimo Dutti Jacket")
  • 46. JDI > JDI API Elements Simple Complex Composite
  • 47. JDI > JDI API Simple Elements
  • 48. JDI > JDI API > Simple Elements
  • 49. JDI > JDI API > Simple Elements
  • 50. JDI > JDI API > Multilocators
  • 51. JDI > JDI API Complex Elements
  • 52. JDI > JDI API > Complex Elements
  • 53. JDI > JDI API > Complex Elements
  • 54. JDI > JDI API > Complex Elements
  • 55. JDI > JDI API > Complex Elements > Enums
  • 56. JDI > JDI API > Typified elements Code readability Clear behavior Union of all element’s locators Union of element and its actions Detailed logging
  • 57. JDI > JDI API > Compare
  • 58. JDI > JDI API > Compare
  • 59. JDI > JDI API Composite Elements
  • 60. JDI > JDI API > Composite Elements
  • 61. JDI > JDI API > Web Site
  • 62. JDI > JDI API > Web Page
  • 63. JDI > JDI API > Section
  • 65. JDI > UI Objects Pattern
  • 66. JDI > UI Objects Pattern
  • 68. JDI > Test Any UI
  • 71. JDI
  • 72. Selenide vs JDI > Language support Native JNI Selene Native Native Not supported