How cretaed Script for REST API | Selenium Forum
M
Posted on 09/10/2015
Hi Ahish

I am stuck over the Rest API using selenium webdriver using TesNg in my project

I want to validate following methods of rest

1.GET -
2.POST-
3.PUT-
4.DELETE-


I just wanted to validate the response code -201 (Created) 200(ok) 404(Not Found) 404(Delete)


Can you please provide any sample working code ,its really very urgent

I am not getting correct code from net

M
Replied on 10/10/2015

sample working code will be difficult but there is a great library by apache http client.

http://www.mkyong.com/webservices/jax-rs/restful-java-client-with-apache-httpclient/
http://alvinalexander.com/java/java-apache-httpclient-restful-client-examples

you can find many example on these sites


M
Replied on 16/10/2015

You can use Rest assured API, its good.