Write Selenide in Python
1
“in 15 minutes”
Write Selenide
in 15 minutes
by Iakiv Kramarenko
Life is Hard:)
SPA… Ajax Everywhere.
1. “Selenium waits” are bulky
2. raw PageObject’s elements are static
2.1. PageFactory is bulky and not flexible enough
?
1. Implicit waiting for elements
2. Element is re-found each time it is asked for
2.1 ElementFactory over PageFactory
for Dynamic Lazy WebElement Proxying
Selenide Harlem Shake video
Reason
Acceptance UI tests still works
because
are easy to write, easy to maintain, in a small suite
open("http://google.com/ncr");
$(By.name("q")).val("selenide").pressEnter();
$$("#ires li.g").shouldHave(size(10));
$("#ires li.g").shouldBe(visible).shouldHave(
text("Selenide: concise UI tests in Java"),
text("selenide.org"));
Like this:)
Cool, no?
but only in Java…
ruby has Capybara + SitePrism :)
You did not here this….
Can we do the same?
Let’s try with python :)
Demo
Sources
• Version with waiting implemented from scratch and
conditions implemented as lambdas
• Version based on Selenium explicit waiters and
expected conditions
Cons for True Testers
I do not use implicit smart waits!
I will control everything with waitUntilAjax()!
Pros for True Slackers
I will write
straightforward,
readable,
maintainable,
user oriented
tests with less time to provide faster feedback for Devs
Test Coverage
by QA QC Automation
vs
Less Bugs
by Devs
Devs write tests?
parallelised
4 threads:)
< 1.5h
~ 5-10 mins
Afterwords
Selene is coming for Python…
Q&A
yashaka@gmail.com
skype: yashaolin
twitter: @yashaka
http://github.com/yashaka/
www.itlabs.net.ua
contact@itlabs.net.ua
+38 (073) 467-61-12
Thank you!

Write Selenide in Python 15 min