Selenium & WebSockets

443 views
Skip to first unread message

Pierre Goupil

unread,
Feb 19, 2014, 1:40:42 PM2/19/14
to seleniu...@googlegroups.com
Hi all,


I have a project which makes an heavy use of WebSockets. Unfortunately, I have very fragile Selenium tests: some things that I have done by hand tens of times breaks almost always in Selenium.

FYI, my technology stack is: Java 6, Atmosphere 2.1, Wicket 6.12, Tomcat 7 and Selenium 2.39. I use Windows 7, Debian 7, FreeBSD 10 and Android.

So, as you see, I have a lot of combinations to test, but for the moment, I concentrate on Selenium tests based on Firefox 27 on Debian 7. When they are stable, maybe I'll change my mind. My app works in FF, IE >= 10, Opera, Safari and Chrome

It's a pity for me that I can't have stable Selenium tests because all these platforms would greatly benefit from automated GUI tests. I've tried with FF, Opera and Chrome on Debian 7 in Jenkins, with no luck.

So, if anyone have an idea about where I should start to look, any help will be much appreciated.

Regards,

Pierre

Shawn McCarthy

unread,
Feb 20, 2014, 10:51:06 AM2/20/14
to seleniu...@googlegroups.com
I don't see any information on what you mean by fragile tests. Do you mean they work some times and not others? Do you have a specific example? A lot of times, fragile/flaky tests are because of race conditions, and after an action, you might need to wait for some other event to occur, before continuing. If you don't wait for the right amount of time or the right action, you may see NoElement or such exceptions.

Pierre Goupil

unread,
Feb 20, 2014, 12:17:11 PM2/20/14
to seleniu...@googlegroups.com


Le jeudi 20 février 2014 16:51:06 UTC+1, Shawn McCarthy a écrit :
I don't see any information on what you mean by fragile tests. Do you mean they work some times and not others?

Absolutely! Sometimes, my WebSocket channel replies instantaneously (just as in my production server), sometimes after 30 seconds they still have received nothing.

 
Do you have a specific example? A lot of times, fragile/flaky tests are because of race conditions, and after an action, you might need to wait for some other event to occur, before continuing. If you don't wait for the right amount of time or the right action, you may see NoElement or such exceptions.
 

Sure. But I do have timeouts and more often that not they expire after a long wait, where as I said, in my production server everything is almost instantaneous.

Maybe the fact that I use two browsers, as the WebSockets tests often require to see if the action in one of them is reflected in the other one?

Regards,

Pierre


Reply all
Reply to author
Forward
0 new messages