Date post: | 13-Feb-2017 |
Category: |
Technology |
Upload: | nikolajs-okunevs |
View: | 417 times |
Download: | 0 times |
1
2
GRAPHWALKER
ALLURE
BROWSERMOB PROXY
3
Application we will play with
https://github.com/SpringSource/spring-
petclinic.git
4
SelenideSelenium Wrapper
SALT ENHANCES FLAVOR OF FOOD..
5
Selenide – PROs
Easy to start
Concise API for tests
Ajax support
Turnkey Solution
Timesaver
6
Browser opening
WebDriver driver = new FirefoxDriver();
driver.get("http://localhost:9966/petclinic/");
SELENIDE
SELENIUM
open("http://localhost:9966/petclinic/");
7
Browser closing after tests
if (driver != null) {
driver.close();
}
SELENIDE
SELENIUM
// Do not care! Selenide closes the browser automatically.
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
Assert that element has a correct text
assertEquals("Customer profile", driver.findElement(
By.id("customerContainer")).getText());
SELENIDE
SELENIUM
$("#customerContainer").shouldHave(text("Customer profile"));
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
Find element by text
WebElement customer = $(byText("Customer profile"));
No way (except XPath)
SELENIDE
SELENIUM
12
Result – more compact tests
13
Selenide - Side Effects
• Tests become slower
• Wrapper doesn’t wraps anything!
– Sometimes had to create wrapper over wrapper
14
Allure – reporting framework
An open-source framework designed to createtest execution reports clear to everyone in theteam.
AllureReporting Framework
15
Allure – reporting framework
“An open-source framework designed to create test execution reports clear to everyone in the team”
16
Problem 1
How the automated tests matched to user behavior (or manual test cases)?
17
Solution – step annotation
• What needs to be done:– Add @Step annotation for needed methods
18
What is covered by automated tests and what are the pain areas?
Problem 2
19
Solution – feature, story annotation
• What needs to be done:– Add @Feature/@Story annotation for needed classes
20
What are the failure reasons of my automated tests?
Problem 3
21
Solution – Failed/Broken statuses
• What needs to be done:– Use default Junit, TestNG status codes
22
Result – good reports, that meet basic Team needs
23
BrowserMob ProxyPerformance Utility
24
Performance metrics
How to get performance metrics?
25
Method 1
Own Timings
26
Method 2
Own Timings
Web Timings
27
Method 3
Own Timings
Web Timings
Browser plugins
28
Method 4
Own Timings
Web Timings
Browser plugins
Using proxy
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
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
31
BrowserMob Proxy – How to use?
Add dependency
32
BrowserMob Proxy – How to use?
Add dependency
Start local proxy server
Use proxy with browser
33
BrowserMob Proxy – How to use?
Add dependency
Start local proxy server
Use proxy with browser
Get data from proxy server
34
HAR file
35
SikuliImage based automation
36
Sikuli – image recognition tool
Operates with images
37
Sikuli – image recognition tool
Operates with images
Lets you automate anything that is displayed on the screen
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
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
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
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
42
Sikuli – Google Maps Example
43
GraphwalkerModel based testing tool
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
Graphwalker – how model works?
The purpose of the test design is to describe the expected behavior of
the system under test.
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
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.
48
Graphwalker - workflow
Create Graph model
http://www.yworks.com/en/products/yfiles/yed/
49
Graphwalker - Workflow
Create Graph model
Generate test sequences
50
Graphwalker - Workflow
Create Graph model
Generate test sequences
Generate Java sources
51
Graphwalker - Workflow
Create Graph model
Generate test sequences
Generate Java sources
Implement interfaces
52
Graphwalker - Workflow
Create Graph model
Generate test sequences
Generate Java sources
Implement interfaces
Running test
53