Symbiosis of test automation tools. Several tools (graphwalker/selenide/allure/sikuli/browsermob proxy) overview and practical appliance in your Selenium automation project will be presented
7. 7
Browser closing after tests
if (driver != null) {
driver.close();
}
SELENIDE
SELENIUM
// Do not care! Selenide closes the browser
automatically.
8. 8
Find element by id
WebElement customer =
driver.findElement(By.id("customerContainer"));
SELENIDE
SELENIUM
WebElement customer = $("#customerContainer");
or a longer conservative option:
WebElement customer = $(By.id("customerContainer"));
9. 9
Assert that element has a correct
text
assertEquals("Customer profile", driver.findElement(
By.id("customerContainer")).getText());
SELENIDE
SELENIUM
$("#customerContainer").shouldHave(
text("Customer profile"));
10. 10
Assert that element does not exist
try { WebElement element = driver.findElement(
By.id("customerContainer"));
fail("Element should not exist: " + element);
} catch (WebDriverException itsOk) {}
SELENIDE
SELENIUM
$("#customerContainer").shouldNot(exist);
11. 11
Find element by text
WebElement customer = $(byText("Customer profile"));
No way (except XPath)
SELENIDE
SELENIUM
13. 13
Selenide - Side Effects
• Tests become slower
• Wrapper doesn’t wraps anything!
– Sometimes had to create wrapper over
wrapper
14. 14
Allure – reporting framework
An open-source framework designed to create
test execution reports clear to everyone in the
team.
Allure
Reporting Framework
15. 15
Allure – reporting framework
“An open-source framework designed to create test
execution reports clear to everyone in the team”
16. 16
Problem 1
How the automated tests matched to user behavior (or
manual test cases)?
17. 17
Solution – step annotation
• What needs to be done:
– Add @Step annotation for needed methods
18. 18
What is covered by automated tests and what are the pain
areas?
Problem 2
19. 19
Solution – feature, story annotation
• What needs to be done:
– Add @Feature/@Story annotation for needed classes
20. 20
What are the failure reasons of my automated tests?
Problem 3
29. 29
BrowserMob Proxy
Is an utility that makes it easy to capture
performance data from browsers, typically written
using automation toolkits such as Selenium
30. 30
Additional features
• Assert the HTTP status code
• Block third-party resources that are slow to load
• Capture HTTP archive (HAR file)
– Then convert it to a JMeter jmx file
37. 37
Sikuli – image recognition tool
Operates with images
Lets you automate anything that is displayed on the screen
38. 38
Sikuli – image recognition tool
Operates with images
Lets you automate anything that is displayed on the screen
No need to have access to application structure
39. 39
Sikuli – image recognition tool
Operates with images
Lets you automate anything that is displayed on the screen
No need to have access to application structure
Cross-platform
40. 40
Sikuli – image recognition tool
Operates with images
Lets you automate anything that is displayed on the screen
No need to have access to application structure
Cross-platform
Open-source
41. 41
Sikuli – image recognition tool
Operates with images
Lets you automate anything that is displayed on the screen
No need to have access to application structure
Cross-platform
Open-source
Provides libraries for test creation in Java
44. 44
Graphwalker - what is this?
Model Based
Build in Java
Reads models in the shape of finite-state diagrams, or graphs,
and generate tests from the models
Modeling syntax is very simple
Comes from Spotify test automation
45. 45
Graphwalker – how model works?
The purpose of the test design is to describe the expected behavior of
the system under test.
46. 46
Graphwalker – how model works?
The purpose of the test design is to describe the expected behavior of
the system under test.
Vertex
A vertex represents an expected state that we want to
examine.
47. 47
Graphwalker – how model works?
The purpose of the test design is to describe the expected behavior of
the system under test.
Vertex
A vertex represents an expected state that we want to
examine.
Edge
Represents the transition from one
vertex to another.