1

I have a question regarding verifying if the POST request was successful or not. Is there a way to achieve this with selenium? Or any other tool that can be integrated with selenium?

Maybe click on the button and check if it returns 200 status or not?

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
Chirag verma
  • 313
  • 2
  • 16
  • What about use [`selenium-requests`](https://pypi.python.org/pypi/selenium-requests/) here? – Remi Guan Nov 08 '15 at 07:21
  • Possible duplicate of [Is there any way to start with a POST request using Selenium?](http://stackoverflow.com/questions/5660956/is-there-any-way-to-start-with-a-post-request-using-selenium) – JeffC Nov 08 '15 at 17:09

1 Answers1

1

In java you can use the Browsermob-Proxy http://bmp.lightbody.net/ which integrates nicely with selenium. What it does, it intercepts all the communication and you can get the statuscode with it. You can try to find a python proxy so you can do the same.

The selenium API won't give you statuscodes. That was a "political" decision some years ago.

On StackOverflow some people suggest sending another request with another tool to check the statuscode. Depending on your usecase that could be enough for you.

d0x
  • 11,040
  • 17
  • 69
  • 104