roman iovlev battle - typified or not tepified elements jdi vs selenide - heisenbug

23
QA Battle of Automation Approaches Элементы с типизацией (JDI) vs. элементы без типизации (Selenide) Roman Iovlev Alexei Vinogradov

Upload: -

Post on 19-Mar-2017

22 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

QA Battle ofAutomation Approaches

Элементы с типизацией (JDI)vs. элементы без типизации (Selenide)

Roman Iovlev Alexei Vinogradov

Page 2: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

Chief QA AutomationIn Testing more than 11 yearsIn Testing Automation 9 years

ROMAN IOVLEV

Page 3: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

Alexei VinogradovIT-Kонсультант

тестирование, управление тестированием, автоматизация в тестировании, коучинг

15+ лет в IT, докладчик SQA Days / Codefest / QA Fest

Студент-практикант -> Программист -> Тестировщик ->…

Page 4: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug
Page 5: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

TYPIFIED ELEMENTS

10 DEC 2016

Page 6: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

TYPIFIED ELEMENTS VS SUPER ELEMENT

6

VS

WebElementSelenideElement

Page 7: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

SIMPLE BUT…

6

$(“#submit”).click();

$(“#submit”).click();

$(“#submit”).click();

$(“#submit”).click();

$(“#submit”).click();

$(“#submit”).click();

$(“#submit”).click();

$(“#submit”).click();

private SelenideElement colorsArrow = $(“#color-arrow“);private List<SelenideElement> colorsValues = $$(“#colors li“);private SelenideElement colorsValue = $(“#colors“);

public void selectColor(String color) { colorsArrow.click(); colorsValues.filter(text(color)).first().click();}public String getColor() { colorsValue.text();}

private SelenideElement submitButton= $(“.submit”)

Page 8: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

3 DROPDOWNS

6

private SelenideElement colorsArrow = $(“#color-arrow“);private List<SelenideElement> colorsValues = $$(“#colors li“);private SelenideElement colorsValue = $(“#colors“);private SelenideElement typesArrow = $(“#type-arrow“);private List<SelenideElement> typesValues = $$(“#types li“);private SelenideElement typesValue = $(“# types“);private SelenideElement shapesArrow = $(“#shape-arrow“);private List<SelenideElement> shapesValues = $$(“#shapes li“);private SelenideElement shapesValue = $(“#shapes “);

public void selectColor(String color) { colorsArrow.click(); colorsValues.filter(text(color)).first().click();}public String getColor() { colorsValue.text();}public void selectType(String type) { typesArrow.click(); typesValues.filter(text(type)).first().click();}public String getType() { typesValue.text();}public void selectShape(String shape) { shapesArrow.click(); shapesValues.filter(text(shape)).first().click();}public String getShape() { shapesValue.text();}

Page 9: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

SO OBVIOUS

6

@JDropdown(expand= “#color-arrow“ list = “#colors li" value = “#colors")public Dropdown colors;

@JDropdown(expand= “#type-arrow“ list = “#types li" value = “#types")public Dropdown types;

@JDropdown(expand= “#shape-arrow“ list = “#shapes li" value = “#shapes")public Dropdown shapes;

• Десятки элементов (> 30 элементов)

• Сотни методов (в ITable > 100)

Actions

Control

ControlBusiness

Page 10: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

SIMPLE BUT…

6

open(“http://my.site.com”);

homePage.open();

open(“http://my.site.com”);open(“http://my.site.com”);

public class HomePage { public void open() { open(“http://my.site.com”); } …}

open(“http://my.site.com”);

Page 11: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

SAVINGS

6

1. Save your time2. Save your Client money3. Get tests with more quality4. Do more interesting things

Page 12: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

SHORT & OBVIOUS

5

public class Filter { public WebElement submitButton; public WebElement followMeLink; public WebElement navigation; public WebElement colors; public WebElement areas; public WebElement settings; public WebElement tags; public WebElement shirtSizes; public WebElement vote; public WebElement rating;

}

public class Filter { public Button submit; public Link followMe; public Menu navigation; public Dropdown colors; public Tabs areas; public Checklist settings; public ComboBox tags; public DropList shirtSizes; public Selector vote; public RadioButtons rating;

}

public class Filter { public _ submitButton; public _ followMeLink; public _ navigation; public _ colors; public _ areas; public _ settings; public _ tags; public _ shirtSizes; public _ vote; public _ rating;

}

public class Filter { public SelenideElement submitButton; public SelenideElement followMeLink; public SelenideElement navigation; public SelenideElement colors; public SelenideElement areas; public SelenideElement settings; public SelenideElement tags; public SelenideElement shirtSizes; public SelenideElement vote; public SelenideElement rating;

}

Page 13: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

click()

isDisplayed()

is()

sendKeys()

attr()

shouldHave()

should()

getLocation()

find()

findElement()

getText()

getCoordinates()

$()

$$()

append()

clickContext()

closest()

ONLY USABLE ACTIONS

5

Button submitButton. click()getText()

SelenideElement submitButton.

Page 14: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

LOGS & REPORTING

5

Click on Login Button Get Row with “Type=Approved” from Products Table Select “Blue” in Color Dropdown Login with “CorrectUser” …

Page 15: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

WORK WITH OBJECTS

5

• registerForm.save(vipClient);• searchForm.find(product);• List<Product> products = products.entities(p -> p.Type == “shoes”);• Card products = cards.entity(c -> c.Status == APPROVED && c.Name.contains(“Duke”));• …ITable products;ITable cards;

EntityDrivenTesting

Page 16: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

WIND OF CHANGE

3

• Fast writing one test• Small projects (< 4 months)• Selenide is better engine

than Selenium but still an engine layer

• Fast writing bunch of tests• Midle-Large projects (> 6 months)• JDI is an UI Automation

Framework and represents Application/Business layer

Page 17: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

PLATO'S THEORY OF FORMS

5

No application but you can write UI Objects (Page Objects )

IButton

Page 18: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

INTERFACES

5

IButton submit;IDropdown cities;ITable products;

MapInterfaceToElement.update( new Object[][]{ { IDropDown.class, MyDropDown.class}, { IButton.class, MyButton.class}, { ITable.class, CustomTable.class} });

Page 19: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

EVERYBODY DO IT

6

1. Save a lot of time - money2. More obvious test scenarios, page objects,

logs, reports – easier develop & support3. Operate with real business Objects4. Write UI Objects (Page Objects) without app5. Easier scenarios reusage on different platforms

Page 20: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

20

WEB TESTING 2.0

PageObjects

Smoke Tests

Page 21: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

BE LAZY

6

Page 22: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

22

PLANS

23

Page 23: Roman iovlev battle - typified or not tepified elements jdi vs selenide - Heisenbug

23

CONTACTS

HTTP://JDI.EPAM.COM/HTTPS://VK.COM/JDI_FRAMEWORK

[email protected]

https://github.com/epam/JDI

INFO CONTACTS