Posts

Tell me About yourself

Image
Tell me about you? HI, this is Sudheer here; I am having 10 years of experience into IT and in which 7 years into Automation testing using Selenium for Web applications ,2 years API testing using rest assured 2 years into Mobile testing , Database Support and 2 years in manual testing. But from last 3 to 4 years I majorly involved into automation using Selenium, Appium ,AccelQ Tools, I would say 60 % into Automation and 40 % percent into Functional testing - manual testing. I am pretty much comfortable with manual testing also like writing the test scenarios, test cases and defect life cycle, test preparation and test plan. I am pretty much comfortable with open source as well as license technology, selenium with java and Webservies Automation testing using RestAssured ,Appium for mobile testing I am pretty much comfortable of designing the framework from the scratch as well as can work on existing framework also. Also ,I am pretty much...

Status code

10  Status Code Definitions Each Status-Code is described below, including a description of which method(s) it can follow and any metainformation required in the response. 10.1  Informational 1xx This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for this class of status code. Since HTTP/1.0 did not define any 1xx status codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions. A client MUST be prepared to accept one or more 1xx status responses prior to a regular response, even if the client does not expect a 100 (Continue) status message. Unexpected 1xx status responses MAY be ignored by a user agent. Proxies MUST forward 1xx responses, unless the connection between the proxy and its client has been closed, or unless the proxy itself requested the generation of the 1xx response. (For exa...

How to handle static json payload external file

Freeformatter.com it will convert json into string package LibaryAPI; import static io.restassured.RestAssured.given; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.testng.annotations.Test; import InputFiles.LibaryMethods; import InputFiles.ResuableMethods; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; public class StaticJson { @Test public void addBook() throws IOException { RestAssured.baseURI="http://216.10.245.166"; // Add the book to the Libary- POST //Given input data String res= given().headers("Content-Type","application/json").body(GenerateStringFroResource ("C:\\Users\\abc\\Desktop\\API\\addBook.json")) //submit- WHEN .when().post("Library/Addbook.php") //Response- THEN .then().assertThat().statusCode(200).extract().response().asString(); JsonPath js1= ResuableMethods.rattoJson(res); Strin...

Json ,Dataprovider,dynamic data

import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static io.restassured.RestAssured.given; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; import io.restassured.response.Response; import files.ReusableMethods; import files.payLoad; public class DynamicJson { @Test(dataProvider="BooksData") public void addBook(String isbn,String aisle) { RestAssured.baseURI="http://216.10.245.166"; Response resp=given(). header("Content-Type","application/json"). body(payLoad.Addbook(isbn,aisle)). when(). post("/Library/Addbook.php"). then().assertThat().statusCode(200). extract().response(); JsonPath js= ReusableMethods.rawToJson(resp);    String id=js.get("ID");    System.out.println(id);    //deleteBOok } @DataProvider(name=...

Sample Libary API - PostMan

Library API : BaseURI : http://216.10.245.166 1.     Resource  : Library/Addbook.php        Method  : POST Input Payload : Json : { "name":"Learn Appium Automation with Java", "isbn":"bcd", "aisle":"227", "author":"John foe" } Output Json  {    "Msg": "successfully added",    "ID": "bcd227" }  1.     Resource  : /Library/GetBook.php ?AuthorName=somename          Method  : GET  Output Json  : Output the array of Json object books with all below  details  { Name : “bookname”   ( String) Isbn :  “A2fdsf”   (String) Aisle : 32 (Integer) } 1.     Resource  : Library/GetBook.php?ID=3389      -  Method  : GET  Output Json : {  ...

Rest Assured API End to end

package com.api.test.decks; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import InputFiles.PayLoad; public class getResponse { public static void main (String args[]) { //given-- all inputs //when-- resource ,sumit the API //then--- validate response RestAssured.baseURI="https://rahulshettyacademy.com"; //Add the address- POST // input text //PayLoad.addPlace()-- payload request String response=given().log().all().queryParam("key", "qaclick123").headers("content-type","application/json") .body(PayLoad.addPlace()) .when().post("maps/api/place/add/json")// resource .then().assertThat().statusCode(200)// response .body("scope", equalTo("APP")) .header("Server", "Apache/2.4.18 (Ubuntu)").extract().asString(); ...