My Blog
Read the Latest News

REST with Selenium?

Yes this title is supposed to get your attention because if you are not doing this and you are capable of doing it, you are doing automation wrong.

Ok maybe not everything wrong. But you could do things faster. Potentially much faster.

Ok How?

Simple use the API to speed up your Selenium tests.

...Explain Mr. Lazy...


If you were to have a API endpoint that can create a user, then there would only be one single request sent to create a user and the response will let you know if the request was successful.

From a selenium point how many requests will need to be sent and responses successful before you could say that the user was created?

  1. Initializing the browser (yes this counts we are assuming a local one)
  2. going straight to the signup page (assuming you can)
  3. get the html pages
  4. load css
  5. load javascript
  6. fill in all of the fields and submit

    And that is at the very least.

    Now maybe you have to do an OAuth call to validate that you can create a user but that is still much faster than using a selenium test to create a user.

Next Post Previous Post