Tests Selenium vs old-school POST / GET

We have a significant code base with relatively high testing coverage for pages / forms, all through vanilla POST / GET.

Now we are moving more into the "ajaxy" space, and it is not quite possible to check with full GET / POST scripts, such as registering users or creating elements, since they are associated with many JavaScript / Ajax calls.

While such things are the most likely candidates for testing with Selenium, I wonder if we need to test Selenium in all directions, leaving the old-school POST / GET tests in general?

The advantages of implementing Selenium seem too good - the ability to run the same GET / POST tests, but in different browsers.

Or am I missing something in the pursuit of cool and trendy things and taking apart old, proven POST / GET tests?

+6
django architecture selenium testing
source share
2 answers

There are advantages and disadvantages to both approaches, so my recommendation would be to use both.

Selenium launches the actual browser and mimics the user interacting with your web application, which can be great if you are testing Ajax features. He can verify that the elements are visible and interact with them just like the user. Another killer feature is the ability to take screenshots through Selenium, which can be incredibly useful in investigating crashes.

Unfortunately, launching a browser and navigating to a specific page / state in your application can be slow, and you will need a lot of equipment if you want to test concurrent users (load testing) using Selenium.

If you just want to check if your HTTP 200 server responds to certain actions or loads test applications, or that the response contains certain values, then a basic POST / GET would be more suitable.

If you decide to go with Selenium's clean testing approach, I would recommend exploring the use of Selenium Grid or a cloud service, as many tests through Selenium can be time consuming.

+6
source share

I think you should definitely use the Selenium and POST / GET (Unit) tests, because the purpose of your unit test is to test the functionality of a specific section of the code, but Selenium conducts integration testing on your web application.

+4
source share

All Articles