Getting Started With Rest Assured 3.X

Introduction

API Automation has become need of hour. Doing only UI Automation does not help in real time projects especially when team has adopted Agile Methodologies. So in that case testing needs to be fast and reliable to deliver product under tight schedule of Sprint. API automation provides a sense of visibility to the product owner that at least data returned from server is validated properly.

For doing the API automation there are many tools which are available in market e.g. SOAP UI, POSTMAN, etc. But personally I don’t prefer using tools as they always comes with fixed set of functionality and features. Sometimes these tools are very helpful getting things done quickly but when we want to do something which not covered by these tools then it can create big issues.

My Experience

Recently I have  started doing API Automation with Rest Assured API, as its not tool. And I was amazed with implementations as I got up and running in no time less than few hours. Rest Assured provides full supports to do API automation of Restful Services with well BDD approach. Rest Assured has been in market since 2011 and basically it was based HTTP libraries but newest version of Rest Assured is more separated from it. If you are well verse with Java Programming then you will love this API.

 

 

Configure Rest Assured

Add below dependencies in maven project. Rest Assured API provides capability to create request and send it server

 

<dependencies>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>json-path</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8.8</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
    </dependencies>

Leave a Reply

%d bloggers like this: