Мощь переполняет с JDI 2.0 - новая эра UI автоматизации

SQALab
SQALabSQALab
POWER OVERWHELMING
17 NOVEMBER 2017
Chief QA Automation
In Testing more than 12 years
In Testing Automation 10 years
ROMAN IOVLEV
roman.Iovlev
roman_iovlev@epam.com
3
?
Test Automation?
• UI Test Framework
• UI Elements oriented
• Dozens of UI elements already implemented
• Most of common problems already solved (e.g.
stabilization)
4
JDI IS
• UI Test Framework
• UI Elements oriented
5
JDI IS
• UI Test Framework
• UI Elements oriented
• Interfaces above engines
6
JDI IS
7
JDI - CODE EXAMPLE
public class Login extends Form<User>
@Css(“.login”) TextField submit;
@XPath(“//*[@id=‘psw’]”) TextField name;
@Text(“Login”) Button login;
@FindBy(xpath = “//*[*[value=‘%’]]Hello”) Menu siteNavigation;
loginForm.loginAs(adminUser);
siteNavigation.select(“About”);
8
JDI - CODE EXAMPLE
@JSite(“http://awesome.site.com”)
public class AwesomeSite extends WebSite;
@JPage(url=“/home”) public static HomePage page;
public class HomePage extends WebPage;
@Css(“.name”) public TextField name;
@XPath(“//*[text()=‘%s’]”) public Menu mainMenu;
…
@Frame(“frameId”) public Advert advertisement;
public class Advert extends Section;
@FindBy(className =“pict”) public Image picture;
@FindBy(css = “.descr") public Text description;
Init(AwesomeSite.class);
• Save your time for Automation Testing
• Fast on start and easy for support tests in future
• Provide stable and detailed results
• Platform - Flexible for any UI project
9
JDI - PROFIT
Test like a boss
• 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
10
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
11
JDI BENEFITS
• Can be used any project 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 for testing
• Based on average calculation of scope reductions for all test
process stages
JDI 2.0
12
13
NEW ARCHITECTURE
WEB MOBILE
DESKTOP
14
NEW ARCHITECTURE
• Less code for new Engines
• More unification
• Guideline for Engines developers
• Implement list of methods with your engine
• Add your engine specific features
• Create list of elements (add only specific
functionality)
15
NEW ARCHITECTURE
• Elements collections
• Simple Web
• Extended Web
• Complex forms and tables
• Shop elements
• Bank / Government / Document elements
…Your collections
• All elements and methods documentation
• Simple start guideline
• Cookbook: JDI features tutorial
• Guideline for contributors
… anything else?
16
DOCUMENTATION
JDI 2.0
FEATURES
17
 Verify layout
 PageObjects generator as Library
 Selenium-Selenide integration
 JDI Http
 JDI on Python
18
JDI 2.0 FEATURES
VERIFY LAYOUT
19
@Image(“/src/test/resources/submitbtn.png”)
@FindBy(text = “Submit”)
public Button submit;
20
VERIFY LAYOUT
submit.isDisplayed();
submit.assertDisplayed();
@ImagesFolder(“/src/test/resources/imgs”)
public EpamSite extends WebSite;
21
VERIFY LAYOUT
@Image(“submitbtn.png”) @FindBy(text = “Submit”)
public Button submit;
public class EpamSite extends WebSite {
public static HomePage homePage;
22
VERIFY LAYOUT - DEFAULT
public class HomePage extends WebPage
@Text(“Submit”) public Button submit;
“src/test/resources/jdi-images/epamsite/
homepage/submit.jpg”
23
VERIFY LAYOUT
homePage.verifyLayout()
homePage.assertLayout() / homePage.checkLayout()
public class HomePage extends WebPage
@Text(“Submit”) Button submit;
@Css(“.name”) TextField name;
@XPath(“//*[text()=‘%s’]”) Menu mainMenu;
@FindBy(text = “Hello”) Label label;
PAGE OBJECTS
GENERATOR
24
new PageObjectsGenerator(rules, urls, output, package)
.generate ();
25
PAGE OBJECTS GENERATOR LIBRARY
RULES
https://domain.com/
https://domain.com/login
https://domain.com/shop
https://domain.com/about
URLS
{"elements": [{
"type":"Button",
"name": “value",
"css": “input[type=button]"
},
…
]}
OUTPUT
src/main/java
PACKAGE
com.domain
<input type=“button” value=“Next”>
<input type=“button” value=“Previous”>
<button class=“btn”>Submit</button>
26
PAGE OBJECTS GENERATOR LIBRARY
"type":"Button",
"name": “value",
"css": “input[type=button]“
"type":"Button",
"name": “text",
"css": “button.btn"
@Findby(css=“input[type=button][value=Next]”)
public Button next;
@Findby(css=“input[type=button][value=Previous]”)
public Button previous;
@Findby(xpath=“//button[@class=‘btn’
and text()=‘Submit’]”)
public Button submit;
Bootstrap rules
Html 5 rules
KendoUI by Telerik rules
…
Your awesome UI framework rules
27
PAGE OBJECTS GENERATOR LIBRARY
28
LOCATOR ANNOTATIONS
@FindBy (model=“btn-model”)
@FindBy (binding=“btn”)
@FindBy (repeat=“r-button”)
@FindBy (text=“Submit”)
@FindBy(name=“Submit”)
@FindBy(value=“Submit”)
@FindBy(title=“Submit”)
@FindBy(type=“Submit”)
@Css(“.submit”)
@XPath(“.submit”)
@Tag(“button”)
@Text(“Test”)
@Value(“st”)
@Type(“//button”)
@Title(“submt-id”)
Angular Selenium
Special
SELENIUM AND
SELENIDE
INTEGRATION
29
30
SELENIUM-SELENIDE INTEGRATION
100%
0%
31
SELENIUM-SELENIDE INTEGRATION
100%
0%
32
SELENIUM-SELENIDE INTEGRATION
100%
0%
33
J ID 2.0
34
WHAT
ABOUT
HTTP ?
35
JDI HTTP
JDI HTTP
@ServiceDomain("http://httpbin.org/")
public class UserService {
@GET("/get") static RestMethod getUser;
@POST("/post") RestMethod updateSettings;
@PUT("/put") RestMethod addUser;
@PATCH("/patch") RestMethod patch;
@DELETE("/delete") RestMethod removeUser;
36
JDI HTTP
@ServiceDomain("http://httpbin.org/")
public class UserService {
@GET("/get") static M getUser;
@POST("/post") M updateSettings;
@PUT("/put") M addUser;
@PATCH("/patch") M patch;
@DELETE("/delete") M removeUser;
37
JDI HTTP
UserService.addUser.call();
RestResponse resp = getUser.call();
assertEquals(resp.status, 200);
assertEquals(resp.statusType, OK);
assertEquals(resp.body(“name"), “Roman");
resp.assertThat(). body("url",
equalTo("http://httpbin.org/get"))
resp.assertThat().header("Connection", "keep-alive");
38
JDI HTTP
app.addUser.send(user);
User actualUser = app.getUser.asData(User.class);
assertEquals(actualUser, user);
39
JDI HTTP EDT
Entities
@ServiceDomain ("http://httpbin.org/")
public class UserService {
@GET ("/get") M<User> getUser;
@PUT ("/put") M<User> addUser;
@ServiceDomain("http://httpbin.org/")
public class UserService {
@ContentType(JSON)
@Headers({
@Header(name = "Name", value = "Roman"),
@Header(name = "Id", value = "Test")
}) @GET("/get") M getUser;
40
JDI HTTP
https://goo.gl/4bV36T
JDI
PYTHON
41
42
JDI PYTHON
43
JDI PYTHON
class AddCVForm(Form):
first_name = TextField (By.css("[placeholder='First Name']"))
last_name = TextField (By.css("[placeholder='Last Name']"))
email = TextField (By.css("[placeholder='Email']"))
country = Dropdown (root=By.css(".country-wrapper"),
by_select_locator=By.css(".arrow"),
…
city = …
cv = RFileInput (By.css(".file-upload"))
comment = TextArea (By.xpath(".comment-input"))
submut = Button (By.xpath("//*[.='Submit']"))
cancel = Button (By.xpath("//*[.='Cancel']"))
https://goo.gl/5S5nDC
JDI 2.0
44
http://jdi.epam.com/
https://github.com/epam/JDI
https://vk.com/jdi_framework
JDI
1 of 44

More Related Content

What's hot(19)

Testing with test_completeTesting with test_complete
Testing with test_complete
binuiweb2.2K views
Selenium Test AutomationSelenium Test Automation
Selenium Test Automation
BabuDevanandam3.7K views
Automation framework Automation framework
Automation framework
ITeLearn2.7K views
Final Automation TestingFinal Automation Testing
Final Automation Testing
priya_trivedi4.7K views
Selenium pptSelenium ppt
Selenium ppt
Anirudh Raja8.1K views
Integrated Proposal   (Vsts Sps Tfs) - MS stackIntegrated Proposal   (Vsts Sps Tfs) - MS stack
Integrated Proposal (Vsts Sps Tfs) - MS stack
Bijoy Viswanadhan1.8K views
Team Foundation Server DemoTeam Foundation Server Demo
Team Foundation Server Demo
phase2int18.7K views
API Testing following the Test PyramidAPI Testing following the Test Pyramid
API Testing following the Test Pyramid
Elias Nogueira1.7K views
TFS 2010: Team Development on CrackTFS 2010: Team Development on Crack
TFS 2010: Team Development on Crack
Steve Lange2.8K views
Introduction To TestlinkIntroduction To Testlink
Introduction To Testlink
guest1425e34.2K views
Automation Testing with TestCompleteAutomation Testing with TestComplete
Automation Testing with TestComplete
RomSoft SRL2.2K views
Testing_with_TestCompleteTesting_with_TestComplete
Testing_with_TestComplete
Samanuru G Chakravarthy528 views
An easy way to automate complex UIAn easy way to automate complex UI
An easy way to automate complex UI
Ivan Pashko680 views

Similar to Мощь переполняет с JDI 2.0 - новая эра UI автоматизации(20)

More from SQALab(20)

Recently uploaded(20)

231112 (WR) v1  ChatGPT OEB 2023.pdf231112 (WR) v1  ChatGPT OEB 2023.pdf
231112 (WR) v1 ChatGPT OEB 2023.pdf
WilfredRubens.com118 views
BYSC infopack.pdfBYSC infopack.pdf
BYSC infopack.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego160 views
GSoC 2024GSoC 2024
GSoC 2024
DeveloperStudentClub1056 views
Psychology KS5Psychology KS5
Psychology KS5
WestHatch56 views
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptx
shoba shoba119 views
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar87 views
Narration lesson plan.docxNarration lesson plan.docx
Narration lesson plan.docx
TARIQ KHAN92 views
Nico Baumbach IMR Media ComponentNico Baumbach IMR Media Component
Nico Baumbach IMR Media Component
InMediaRes1368 views
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan256 views
ANATOMY AND PHYSIOLOGY UNIT 1 { PART-1}ANATOMY AND PHYSIOLOGY UNIT 1 { PART-1}
ANATOMY AND PHYSIOLOGY UNIT 1 { PART-1}
DR .PALLAVI PATHANIA190 views
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov74 views
Psychology KS4Psychology KS4
Psychology KS4
WestHatch54 views
SIMPLE PRESENT TENSE_new.pptxSIMPLE PRESENT TENSE_new.pptx
SIMPLE PRESENT TENSE_new.pptx
nisrinamadani2159 views
Plastic waste.pdfPlastic waste.pdf
Plastic waste.pdf
alqaseedae94 views
ACTIVITY BOOK key water sports.pptxACTIVITY BOOK key water sports.pptx
ACTIVITY BOOK key water sports.pptx
Mar Caston Palacio275 views
Material del tarjetero LEES Travesías.docxMaterial del tarjetero LEES Travesías.docx
Material del tarjetero LEES Travesías.docx
Norberto Millán Muñoz60 views
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxGopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Debapriya Chakraborty479 views
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 Breakdown
WestHatch53 views

Мощь переполняет с JDI 2.0 - новая эра UI автоматизации

  • 2. Chief QA Automation In Testing more than 12 years In Testing Automation 10 years ROMAN IOVLEV roman.Iovlev roman_iovlev@epam.com
  • 4. • UI Test Framework • UI Elements oriented • Dozens of UI elements already implemented • Most of common problems already solved (e.g. stabilization) 4 JDI IS
  • 5. • UI Test Framework • UI Elements oriented 5 JDI IS
  • 6. • UI Test Framework • UI Elements oriented • Interfaces above engines 6 JDI IS
  • 7. 7 JDI - CODE EXAMPLE public class Login extends Form<User> @Css(“.login”) TextField submit; @XPath(“//*[@id=‘psw’]”) TextField name; @Text(“Login”) Button login; @FindBy(xpath = “//*[*[value=‘%’]]Hello”) Menu siteNavigation; loginForm.loginAs(adminUser); siteNavigation.select(“About”);
  • 8. 8 JDI - CODE EXAMPLE @JSite(“http://awesome.site.com”) public class AwesomeSite extends WebSite; @JPage(url=“/home”) public static HomePage page; public class HomePage extends WebPage; @Css(“.name”) public TextField name; @XPath(“//*[text()=‘%s’]”) public Menu mainMenu; … @Frame(“frameId”) public Advert advertisement; public class Advert extends Section; @FindBy(className =“pict”) public Image picture; @FindBy(css = “.descr") public Text description; Init(AwesomeSite.class);
  • 9. • Save your time for Automation Testing • Fast on start and easy for support tests in future • Provide stable and detailed results • Platform - Flexible for any UI project 9 JDI - PROFIT Test like a boss
  • 10. • 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 10 JDI BENEFITS
  • 11. • 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 11 JDI BENEFITS • Can be used any project 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 for testing • Based on average calculation of scope reductions for all test process stages
  • 14. 14 NEW ARCHITECTURE • Less code for new Engines • More unification • Guideline for Engines developers • Implement list of methods with your engine • Add your engine specific features • Create list of elements (add only specific functionality)
  • 15. 15 NEW ARCHITECTURE • Elements collections • Simple Web • Extended Web • Complex forms and tables • Shop elements • Bank / Government / Document elements …Your collections
  • 16. • All elements and methods documentation • Simple start guideline • Cookbook: JDI features tutorial • Guideline for contributors … anything else? 16 DOCUMENTATION
  • 18.  Verify layout  PageObjects generator as Library  Selenium-Selenide integration  JDI Http  JDI on Python 18 JDI 2.0 FEATURES
  • 20. @Image(“/src/test/resources/submitbtn.png”) @FindBy(text = “Submit”) public Button submit; 20 VERIFY LAYOUT submit.isDisplayed(); submit.assertDisplayed();
  • 21. @ImagesFolder(“/src/test/resources/imgs”) public EpamSite extends WebSite; 21 VERIFY LAYOUT @Image(“submitbtn.png”) @FindBy(text = “Submit”) public Button submit;
  • 22. public class EpamSite extends WebSite { public static HomePage homePage; 22 VERIFY LAYOUT - DEFAULT public class HomePage extends WebPage @Text(“Submit”) public Button submit; “src/test/resources/jdi-images/epamsite/ homepage/submit.jpg”
  • 23. 23 VERIFY LAYOUT homePage.verifyLayout() homePage.assertLayout() / homePage.checkLayout() public class HomePage extends WebPage @Text(“Submit”) Button submit; @Css(“.name”) TextField name; @XPath(“//*[text()=‘%s’]”) Menu mainMenu; @FindBy(text = “Hello”) Label label;
  • 25. new PageObjectsGenerator(rules, urls, output, package) .generate (); 25 PAGE OBJECTS GENERATOR LIBRARY RULES https://domain.com/ https://domain.com/login https://domain.com/shop https://domain.com/about URLS {"elements": [{ "type":"Button", "name": “value", "css": “input[type=button]" }, … ]} OUTPUT src/main/java PACKAGE com.domain
  • 26. <input type=“button” value=“Next”> <input type=“button” value=“Previous”> <button class=“btn”>Submit</button> 26 PAGE OBJECTS GENERATOR LIBRARY "type":"Button", "name": “value", "css": “input[type=button]“ "type":"Button", "name": “text", "css": “button.btn" @Findby(css=“input[type=button][value=Next]”) public Button next; @Findby(css=“input[type=button][value=Previous]”) public Button previous; @Findby(xpath=“//button[@class=‘btn’ and text()=‘Submit’]”) public Button submit;
  • 27. Bootstrap rules Html 5 rules KendoUI by Telerik rules … Your awesome UI framework rules 27 PAGE OBJECTS GENERATOR LIBRARY
  • 28. 28 LOCATOR ANNOTATIONS @FindBy (model=“btn-model”) @FindBy (binding=“btn”) @FindBy (repeat=“r-button”) @FindBy (text=“Submit”) @FindBy(name=“Submit”) @FindBy(value=“Submit”) @FindBy(title=“Submit”) @FindBy(type=“Submit”) @Css(“.submit”) @XPath(“.submit”) @Tag(“button”) @Text(“Test”) @Value(“st”) @Type(“//button”) @Title(“submt-id”) Angular Selenium Special
  • 36. @ServiceDomain("http://httpbin.org/") public class UserService { @GET("/get") static RestMethod getUser; @POST("/post") RestMethod updateSettings; @PUT("/put") RestMethod addUser; @PATCH("/patch") RestMethod patch; @DELETE("/delete") RestMethod removeUser; 36 JDI HTTP
  • 37. @ServiceDomain("http://httpbin.org/") public class UserService { @GET("/get") static M getUser; @POST("/post") M updateSettings; @PUT("/put") M addUser; @PATCH("/patch") M patch; @DELETE("/delete") M removeUser; 37 JDI HTTP
  • 38. UserService.addUser.call(); RestResponse resp = getUser.call(); assertEquals(resp.status, 200); assertEquals(resp.statusType, OK); assertEquals(resp.body(“name"), “Roman"); resp.assertThat(). body("url", equalTo("http://httpbin.org/get")) resp.assertThat().header("Connection", "keep-alive"); 38 JDI HTTP
  • 39. app.addUser.send(user); User actualUser = app.getUser.asData(User.class); assertEquals(actualUser, user); 39 JDI HTTP EDT Entities @ServiceDomain ("http://httpbin.org/") public class UserService { @GET ("/get") M<User> getUser; @PUT ("/put") M<User> addUser;
  • 40. @ServiceDomain("http://httpbin.org/") public class UserService { @ContentType(JSON) @Headers({ @Header(name = "Name", value = "Roman"), @Header(name = "Id", value = "Test") }) @GET("/get") M getUser; 40 JDI HTTP https://goo.gl/4bV36T
  • 43. 43 JDI PYTHON class AddCVForm(Form): first_name = TextField (By.css("[placeholder='First Name']")) last_name = TextField (By.css("[placeholder='Last Name']")) email = TextField (By.css("[placeholder='Email']")) country = Dropdown (root=By.css(".country-wrapper"), by_select_locator=By.css(".arrow"), … city = … cv = RFileInput (By.css(".file-upload")) comment = TextArea (By.xpath(".comment-input")) submut = Button (By.xpath("//*[.='Submit']")) cancel = Button (By.xpath("//*[.='Cancel']")) https://goo.gl/5S5nDC

Editor's Notes

  1. Работаю в компании Epam в