Selenium C# Firefox Waits
-
We're testing an awful Angular 2 app with Selenium in C#.
On IE and Chrome, everything is perfect.
On Firefox (and I think Edge?) none of the
webdriverWait.Until()
stuff does any kind of waiting: no matter how much time you give it, it immediately returns with a message that it waited 0 seconds, or with the element.Same with implicit waits.
No kind of waiting works at all in Firefox. How can someone mess up an API so badly that calling something literally named
wait
does no waiting?Can anyone, anyone at all tell me how to get this to wait? I'm about to use
Thread.Sleep()
if someone doesn't stop me!
-
I did it with
Thread.Sleep
. In awhile(true)
with a try and acatch { continue; }
.I hate everything.
But it works.....
-
@Magus Right, so, I at least catch the right exception now, so I hate it less.
Thread.Sleep
is guaranteed to be consistent across all drivers and browsers. Unlike that terrible mess, Selenium.The world needs a far better default web testing toolkit.
-
-
@asdf said in Selenium C# Firefox Waits:
@Magus said in Selenium C# Firefox Waits:
The world needs a far better
defaultwebFTFY
QFT
-
@Magus said in Selenium C# Firefox Waits:
The world needs a far better default web testing toolkit.
Well, there is one I can think of, but it's subject to employment laws and minimum wage and stuff like that.
-
IME attempting to run automated tests against a UI, whether native or of the HTML variety, is an exercise in frustration, futility and pain.
-
@masonwheeler The webdriver works great on Chrome and IE. If all of them were written in such a way that when you call a method on a thing called 'wait', it waits, it would be trivial to test on four major browsers.
And yet the people writing these things can't get a simple API right.
-
@Magus See above, re: exercise in frustration, futility and pain. I bet there are good reasons why it doesn't work on those other browsers. They're just at a lower level of abstraction than you are.
-
@masonwheeler If your software does not do what it says it does, you do not release it outside a prerelease branch. I don't care if it's hard, you don't go around shooting other devs in the foot.
Don't apologize for them.
-
@Magus said in Selenium C# Firefox Waits:
I don't care if it's hard, you don't go around shooting other devs in the foot.
If only someone had told that to the C++ standards committee…
-
@Magus said in Selenium C# Firefox Waits:
If your software does not do what it says it does, you do not release it outside a prerelease branch.
Maybe for developer tools, but there are some pretty good video games that lie to the player.
-
@ben_lubar you mean like GT2, where if you complete everything, it says "98.25%"?
-
@Gąska said in Selenium C# Firefox Waits:
@ben_lubar you mean like GT2, where if you complete everything, it says "98.25%"?
-
@Magus said in Selenium C# Firefox Waits:
If your software does not do what it says it does, you do not release it outside a prerelease branch.
Ponders making a joke about anti-virus software.