Selenium and HTTP responses.

26 views
Skip to first unread message

Madis Kangro

unread,
Mar 31, 2015, 6:33:33 AM3/31/15
to seleniu...@googlegroups.com
I'm currently writing tests and the problem is that occasionally the tests fail because of a loading ajax or javascript. Is it possible to check if the response gives an 200 or an ok message before trying to click the element. 

Krishnan Mahadevan

unread,
Mar 31, 2015, 6:46:17 AM3/31/15
to Selenium Users
Madis,

You cannot do this directly via Selenium WebDriver. But if you employ a proxy server such as BrowserMobProxy (this is very much compatible with Selenium), then this should be easily possible.

Please refer here to get started with BMP https://github.com/lightbody/browsermob-proxy

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Tue, Mar 31, 2015 at 3:48 PM, Madis Kangro <madis...@gmail.com> wrote:
I'm currently writing tests and the problem is that occasionally the tests fail because of a loading ajax or javascript. Is it possible to check if the response gives an 200 or an ok message before trying to click the element. 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/08b25da3-5fa0-4d55-bb8e-76006d1b30eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages