Hacker News new | ask | show | jobs
by holtalanm 3349 days ago
The reasons for failures this artcle outlines are all pretty good. Weak selectors will get you into trouble pretty quick.

Also, I would definitely look up Selenium's implicitWait functionality, as that can fix a lot of "timing" issues within front-end tests. FluentWait is pretty awesome as well (In the past, I have actually implemented my own FluentWait that was independent from the Selenium libraries, because it was so awesome).

If your app supports multiple browsers, make sure you run your tests on all of them when developing -- I can't count how many times I have gotten a test to run reliably with Firefox, only to find out it is broken on Chrome.

Also, for the love of god do NOT use record/playback to generate your tests. The code that it creates, while a time-saver in the short run, is an absolute nightmare for maintenance. (at least it used to be, I haven't used it in the past two years).

Credit: 2+ years writing automated tests, and experience building three separate Selenium test frameworks in two different languages.