Category

Automation

Specification Re-use in Rest-Assured with ResponseSpecBuilder and RequestSpecBuilder

By | Automation, Rest Assured | 7 Comments

When you are writing tests against your API in Rest-Assured you might have some common expected results that you want to check every single time that you call the API. For example, look at the very simple test below: @Test public void testSomeApi() { when(). get(“http://yourWebsiteAddress.com/someAPIcall”). then(). statusCode(200). body(containsString(“Your Website Title”)); } What this test is doing is calling the ‘someAPIcall’ on ‘http://yourWebsiteAddress.com’ and then checking that the status code…

Read More

Add some ‘Weight’ to your Selenium Tests with ‘Waits’! – Part 4: Create your own Wait Methods

By | Automation, Selenium | 3 Comments

In the previous three blog posts in this series we have covered three different types of Selenium waits: Part 1 – Implcit Waits Part 2 – Explicit Waits Part 3 – Fluent Waits Feel free to go back over any of the posts above if you need to refresh your memory or have a recap. In this, the final blog post of the series on Waits, we are going to…

Read More

Add some ‘Weight’ to your Selenium Tests with ‘Waits’! – Part 3: Fluent Waits

By | Automation, Selenium | 5 Comments

In the last blog post we looked at Explicit waits, and we discussed why these are probably the default waits that you want to start with for the majority of your Selenium scripts, especially if you are new to Selenium. Today we are going to look at another type of waits – Fluent waits. Fluent waits are a little bit more advanced in that they have more customisation available to…

Read More

Going Further with Rest-Assured – Part 2: Parameterised Testing with JUnitParams

By | Automation, Rest Assured | 5 Comments

In part 1 of this series on Going Further with Rest-Assured, we looked at creating classes for our test data within our test code and then saw how we can put that data into a Java Map. We also took some example JSON and used Rest-Assured to create another Map of that data, so that we can compare the two. This post will follow on directly from the last one…

Read More

Going Further with Rest-Assured – Part 1: Writing and Using Test Data in your Framework

By | Automation, Rest Assured | 5 Comments

In the previous blog post we looked at how we can extract data from an API call directly into our tests using Rest-Assured and had a look at a couple of basic tests that we could execute against that data. One small issue with the previous post is that we did not have an actual API that we could use (unless you happened to have access to one), but I…

Read More
REST Assured Response Extract title image

Extracting a JSON Response with Rest-Assured

By | Automation, Rest Assured | 34 Comments

In the previous blog post on Getting up and Running with Rest-Assured, we went over everything that we needed to get up and running quickly. In this post I am going to focus on one of the features of Rest-Assured that I use regularly:¬†extracting a response Update Notice (25th Aug 2017) Please be aware that this post is over 2 years old. I have many more REST Assured posts on…

Read More

Getting up and Running with Rest-Assured

By | Automation, Rest Assured | 12 Comments

Testing APIs directly is becoming a bigger trend in the Test Automation world. A great open-source Java library that I have been using for this testing, with great success, is Rest-Assured. In this blog post, I am going to cover everything that you need to get up and running quickly with Rest-Assured. So just what exactly is Rest-Assured? Rest-Assured is an open-source Java Domain-Specific Language (DSL). It eliminates the requirement…

Read More

Add some ‘Weight’ to your Selenium Tests with ‘Waits’! – Part 2: Explicit Waits

By | Automation, Selenium | 5 Comments

In Part 1 of this series on Waits in Selenium (here) we had a look at Implicit Waits. We observed that whilst Implicit Waits are a good way to quickly and easily add some waits to your Selenium tests, they are far from perfect and they do raise some problems for us. Today we are going to learn about another type of waits – Explicit Waits. These types of waits…

Read More

Add some ‘Weight’ to your Selenium Tests with ‘Waits’! – Part 1: Implicit Waits

By | Automation, Selenium | 5 Comments

In this series of blog posts we are going to learn about a fundamental component of Selenium tests – waits. Why would we need to use waits in our tests? Well whenever you are using a webpage you will often find that certain elements are not available on the page right away, either because they are still being loaded or for some other reason. Without any waits in your scripts,…

Read More

Using Assertions in your Selenium Tests

By | Automation, Selenium | No Comments

In today’s blog post we are going to learn a bit more about some of the most common assertions used in Selenium testing and get some practice with them. Writing good assertions are a critical part of writing good automation tests as they are used to determine whether an expected behaviour has occurred (or not) and will control whether or not the test will ultimately pass or fail. For this…

Read More