then you can grab an element on the previous page, do whatever causes the navigation, then wait for "staleness of" the element you just got the reference to.
i don't know if python has a built-in expected condition for staleness of an element, but it's not that hard to gin one up.
zathras
div#container exists on page=1 I click next and wait for div#container, it already is there so the code continues
jimevans
no, you're missing the point.
say `element` refers to an element located by `div#container`. you with me so far?
zathras
The error I get is: selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
jimevans
stay with me, here zathras.
zathras
k
jimevans
you have a reference to element `div#container` right?
then you click.
then you use webdriverwait to wait for the reference to be stale.
after that, you can look for `div#container` (again using webdriverwait), and guarantee that the new one you find is on the page *after* the navigation caused by the click.
it's two webdriverwaits back to back.
one to wait for staleness of, the next to wait for the presence of the element to return.
so webdriverio is one implementation and webdriverjs is the "official" implementation yet the founder of selenium at sauce labs is endorsing webdriverio, but webdriverjs has shitty promise syntax so. I'm not confused as to which one to pick at all
D3M0S joined the channel
there's also others like nighwatch js and protractor and shittyJavascriptSeleniumDriver.js 1 2 3 4 5 etc.
errant_rider
humanbird: the founder of selenium does not work at Sauce anymore(if you mean Jason Huggins)?
D3M0S is now known as Guest74561
jimevans
and hasn't been seriously involved with selenium development in *years*.
dude-x
zathras i kind of suspected that you had to wait for a new page to load
humanbird
so... which driver do you choose?
mach6
don't forget nemo.js ... gotta love js developers. :)
errant_rider
humanbird: i'm not a fan of JS based drivers
Async is not a good way to write tests
you make your life super difficult
dude-x
i also ported the expected conditions to python :)
humanbird
is it so important to be "official" as to pick webdriverjs that you deal with .then(function(){}).then(function(){}).then for EVERY findElementBy?
marxarelli is now known as marxarelli|afk
errant_rider, webdriverio is synchronous
jimevans wishes jleyba were in the channel because i'm sure he'd love to hear his work described as "shitty"
qageek-sl has quit
shookees has quit
promises in the tests are pretty bad you must admit
errant_rider
humanbird: so what is your goal?
marxarelli|afk has quit
if you like WD.io use it
jimevans
humanbird: i don't generally work in js, so i really don't have an opinion one way or the other.
juangj
you are welcome to choose whatever implementation works for you
i'll point out here that the developer of the IE driver is an awful person, a shitty developer, and can barely get his shoes tied in the morning, much less produce code that works.
humanbird
in wdio it's basically .element("#someDivId").getText()
mach6
jimevans: rofl
humanbird
u are talking about yourself jim?
jimevans
mach6: #truestory
humanbird
kek
so "officialness" is really just not important
juangj
not to you, apparently
mach6
age is a bitch.. all I will say
brentlavelle-sl joined the channel
humanbird
is there a level of wc3 conformity between webdriverjs and webdriverio?
jimevans
humanbird: i would not refer to anyone else, nor their work, especially something they'd spent volunteer time creating that way.
marxarelli joined the channel
so, yes, i'm talking about me.
gary1981-sl has quit
juangj
i would expect they will both be w3c compliant in the long run, yes
in the long run we are all dead, but what can you do
humanbird
is there anything that wdio and webdriverjs do that the other doesn't (aside from the async vs sync feature)
errant_rider
wd.io has some built in conformity with many of the common unit test frameworks like junit etc
have you read the manual for WD.io?
humanbird
webdriverio the javascript binding doesn't work with junit
guess if i don't want chained/nested then(function(){}).then(function(){}).then(function(){}).then(function(){}).then(function(){}).then(function(){}) i'd just pick webdriverio
every single selector... by id. by name. you add a then. then then then then then
errant_rider
so perhaps if you dislike the JS bindings, you can use one of the many other bindings?
humanbird
errant_rider: like... using the Java/c#/Python binding in a nodejs shop?
and having a git subrepository cuz we are special?
and developers never ever looking at the tests ever because "EW. python/java/c#"
juangj
i'm not sure what answers you are looking for here. pick the language that works best for your situation. in JS, there are a few choices of bindings. pick the one you like best.
humanbird
seems pretty clear that i will just pick webdriverio because it is inherently superior.
to the other alternative
juangj
if you have suggestions for how to improve one, then suggest them
we all like to whine about design choices, but understand that different choices were made by different projects for different reasons
it's just not that productive to go around saying somebody's work is "shitty" -- you're free to have the opinion and act on it, but please try to offer your criticism in a constructive way
titusfortner-sl has quit
humanbird
async offers absolutely no performance increases/features that any tester would care about (the user isn't opening 10 tabs at the same time and looking at content at all of them simultaneously)
dude-x joined the channel
brentlavelle-sl has quit
btw, i didn't say webdriverjs was shitty. just that promise syntax over and over again is
it really is.
besides. the core nodejs developers have already abandoned the project
juangj
well, perhaps you can choose your phrasing more carefully in the future
humanbird
there's like 1 left
timnab-sl joined the channel
lindsey-sl joined the channel
most of nodejs is owned by ibm and joyent now
lucast-sl joined the channel
dude-x
did they change the license?
humanbird
still mit for now
for express at least
not that there aren't people making another 20 middle tier javascript frameworks due to IBM owning the big one
i like the whole syntax where you can thisIsAFunctionCall(browser.element("#something").getText)
no more chaining etc
ojtua__ has quit
zathras has quit
JasnoWa_ has quit
even better, pass a function reference that returns a value
ojtua_ joined the channel
mdilts-sl joined the channel
smccarthy
I agree that its easier to use a non-async choice, but I don't think its too bad after you get used to it. I would prefer a different language binding if it was my choice tho (java). I would even prefer a different JS binding too (webdriver.io for its active community)... but the choice isn't mine.
errant_rider joined the channel
hmcgowan-sl joined the channel
ojtua has quit
lucast-sl joined the channel
errant_rider has quit
llaskin-sl joined the channel
errant_rider joined the channel
humanbird
using '.' as a line separator is worse than using the optional ';'
i just don't want to do it kek
ojtua joined the channel
anyways they are giving me some freedom here (within the confounds of nodejs) to pick whatever tools