what is the taste of the selenide
TRANSCRIPT
![Page 1: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/1.jpg)
What is the taste of
the Selenide?MARINSKY ROMA
TICKETS.UA
![Page 2: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/2.jpg)
Selenium
Selenium is an umbrella project encapsulating a variety
of tools and libraries enabling web browser automation
WebDriver, Selenium IDE, Selenium Grid
W3C WebDriver specification
![Page 3: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/3.jpg)
Selenium
Need allot of boilerplate for:
Init browsers
Wait for availability of any elements
Screenshots
Logs
Upload and download files
PageObject and PageFactory
![Page 4: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/4.jpg)
Wrapper around Selenium WebDriver not a framework
Fluent API for simple using all features
Supporting AJAX for stable tests, forgot: StaleElementExaptions
Simple waiting for any conditions for each element
Multifunctional Selectors
Simple Configurations for project with tests
![Page 5: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/5.jpg)
UI Tests: Selenide
![Page 6: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/6.jpg)
Selenide.class
$(css), $(By by), $x(xpath), $(By, index)
$$(css), $$(By by), $$x(xpath)
open(…) //URL, Login, PF
selectRadio(By, withText)
switchTo()
page() //for PageFactory *initElements(.class)*
![Page 7: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/7.jpg)
![Page 8: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/8.jpg)
Selenide.class
executeJavaScript()
actions()
Wait()
clearAllCookies()
clearLocalStorage()
zoom()
screenshot()
![Page 9: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/9.jpg)
![Page 10: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/10.jpg)
SelenideElement actions
followLink(), click(), contextClick()
setValue(string), val(), append()
uploadFile()
selectOption(By, text)
scrollTo(), hover(), dragAndDrop()
getText(), getValue(), getAttribute()
![Page 11: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/11.jpg)
![Page 12: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/12.jpg)
Should’ы and Wait’ы
should(Condition condition)
shouldHave()
shouldBe()
shouldNot(Condition condition)
shouldNotHave()
shouldNotBe()
waitUntil(Condition, timeout, pooling)
waitWhile(Condition, timeout, pooling)
waitUntil(Condition, timeout)
waitWhile(Condition, timeout)
![Page 13: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/13.jpg)
![Page 14: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/14.jpg)
ElementCollection actions
shouldHaveSize(Condition)
get(index), first(), last()
filter(Condition), filterBy(Condition) -> collection
find(Condition), findBy(Condition) -> element
exclude(Condition), excludeBy(Condition)
![Page 15: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/15.jpg)
![Page 16: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/16.jpg)
Conditions
visible, appear
exist, present
hidden, disappear
attribute(), attribute(name, value)
value(), name(), type(), id(), cssClass()
empty
matchText(regex), text(), exactText(), textCaseSensitive(), exactTextCaseSensitive()
focused, enabled, disabled,
selected, checked, readOnly
not(Condition), and(because,Condition),
or(because, Condition), be(), have()
![Page 17: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/17.jpg)
![Page 18: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/18.jpg)
CollectionConditions
get()
size(), sizeGreaterThan(),
sizeGreaterThanOrEqual()
sizeLessThan(),
sizeLessThanOrEqaul(), sizeNotEqual()
texts(…), exactTexts(…)
empty
![Page 19: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/19.jpg)
![Page 20: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/20.jpg)
WebDriverRunner
isFirefox, isHtmlUnit, isChrome, isSafari,
isHeadless, isEdge…
source()
url(), currentFrameUrl()
clearBrowserCache()
supportsModalDialogs(),
supportsJavascript()
Browser name constants(chrome,ff...)
addListeners(WebDriverEventListener)
setWebDriver(customDriver),
closeWebDriver()
getWebDriver(),
getAndCheckWebDriver(),
hasWebDriverStarted()
setProxy()
![Page 21: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/21.jpg)
Configuration
clickViaJs, fastSetValue
captureJsErrors
screenshots, savePageSource,
reportFolder, reportsUrl
dismissModalDialogs
selectorMode [css, sizzle]
assertionMode [soft, strict]
fileDownload [httpget, proxy]
baseUrl, browser
timeout, collectionTimeout
poolingInterval,
coollectionPoolingInterval
holdBrowserOpen,
reopenBrowserOnFail,
closeBrowserMs
remote
browserSize, startMaximized
![Page 22: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/22.jpg)
Extra selectors and parent
selectors withText(), byText()
byAttribute(), by()
byTitle(), byValue(), byId(), byName()
byXpath()
byLinkText(), byPartialLinkText()
byCssSelector()
byClassName
$(“tr td.dig”).parent()
$(“tr td.dig”).closest(“th”)
![Page 23: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/23.jpg)
Bonus features #1
Configuration.fileDownload = PROXY;
File testFile = $(“#file”).download();
Download files via proxy
Use when form have no href or other url
for start downloading file
Download file starts after click on the
form.
Will starts proxy server witch intercepts
downloading files
![Page 24: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/24.jpg)
Bonus features #2
You can use:
LoginForm loginForm = new LoginForm();
loginForm.submit.click();
Instead of:
LoginForm loginForm = page(LoginForm.class);
loginForm.submit.click();
Selenide PageFactory
You can use:
SelenideElement submit = $(“#submit”),
loginInput = $(“input.login”);
Instead of:
@FindBy(css=“#submit”)
SelenideElement submit;
@FindBy(css=“input.login”)
SelenideElement loginInput;
![Page 25: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/25.jpg)
Bonus features #3
Simple Logger
When you need logging all element actions do not use log4j and others
Use:
@Rule || @Listener
public TextReport = new TextReport();
Or
new TextReport().onFailedTest(true)
.onSucceededTest(false)
![Page 26: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/26.jpg)
![Page 27: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/27.jpg)
![Page 28: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/28.jpg)
Bonus features #4
Screenshots
When you need screenshots on each
fail test or more
Use:@Rule || @Listenerpublic ScreenShooter = ScreenShooter.failedTests();
Or: ScreenShooter.failedTests(). succeededTests();
![Page 29: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/29.jpg)
![Page 30: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/30.jpg)
How to start?
Include dependencies: selenide & webdrivermanager
Use static imports for Selenide’s methods
Keep it simple stupid!
![Page 31: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/31.jpg)
WebDriver Manager
https://github.com/bonigarcia/webdrivermanager
![Page 32: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/32.jpg)
Myths about Selenide
Will be it enterprise? – No
Selenide will do tests slower! – No
Need to know Selenium at the first! – No
Selenide it isn’t OOP framework! – No
Does not have typed elements! – So what?
It’s boilerplate
![Page 33: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/33.jpg)
Links & contacts
github.com/rmarinsky
fb.com/newromka
ru.selenide.org
software-testers.herokuapp.com
automated-testing.info/
![Page 34: What is the taste of the Selenide](https://reader031.vdocument.in/reader031/viewer/2022013106/58e576e11a28abbf5d8b4a85/html5/thumbnails/34.jpg)
Thank you for attention
Questions?