How to Perform Post, Delete, Put Method in Rest Assured- API Testing-

  Рет қаралды 124,229

Mukesh otwani

Mukesh otwani

Күн бұрын

Пікірлер: 160
@RameshKumar-qm3yf
@RameshKumar-qm3yf 5 жыл бұрын
Hi Mukesh, Thank you for teaching us RestAssured API. You are so kindhearted by taking your precious time and teaching us for free. Be Blessed by Diving power.
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Thank you so much Ramesh, your comment made my day.
@seemamotwani8451
@seemamotwani8451 3 жыл бұрын
Explained in very simple and easy way. Thanks
@venkat-JAKKEPALLI
@venkat-JAKKEPALLI 3 жыл бұрын
Really helpful.. Thanks for clear explanation mukesh..
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thanks Venkat
@KiranKumar-jj9vu
@KiranKumar-jj9vu 6 жыл бұрын
Hi Mukesh, Your teaching are simple & more valuable. Appreciate your efforts. For big payload, you said, POJO, File Models. May I know when can we expect those videos. Thank you!
@siddeshwarmithbavkar4232
@siddeshwarmithbavkar4232 6 жыл бұрын
Best video for beginners in API automation!
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
I am glad you liked it..
@kushanchoudhury1942
@kushanchoudhury1942 6 жыл бұрын
Wonderful...please share some more videos on Rest API...thanks Mukesh!! :)
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Sure Kushan will upload after 9 feb
@YuTuBeKuMiBoY
@YuTuBeKuMiBoY 5 жыл бұрын
you are the greatest man ever, i want to be like you one day.
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Yes you will be buddy, I can guide you whenever you need my help. Feel free to reach out to me for any issue.
@sgstuff3981
@sgstuff3981 6 жыл бұрын
Thanks Mukesh, you have explained the concepts in more easy way. Sometimes in API testing ,server asked for client authentication before proceeding for actual api testing, can u pls explain how to automate it using REST Assured
@AbhishekKumar-no8xe
@AbhishekKumar-no8xe 6 жыл бұрын
Excellent work Mukesh. I learned the selenium and now Rest API from your tutorial. Well Explained ! Have a question from what I read somewhere that REST is stateless, therefore the SERVER has no state (or session data). If there is no Session Data then how REST Client can "Cache" it and utilize it again(If triggered to same endpoint)?
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Hi Abhishek good question.. When you send request to server and server process your request then you will get sessionid,cookies and other information which you can use for further calls.
@AbhishekKumar-no8xe
@AbhishekKumar-no8xe 6 жыл бұрын
Mukesh otwani Thank you for the reply. I guess we get these details in response from the REST server. If not then whats the key difference. Correct me if I am wrong.
@abhilashpulimamidi1742
@abhilashpulimamidi1742 6 жыл бұрын
Hey Mukesh , thanks for making videos on REST. I’ve small doubt. What’s the difference between Rest assured and Rest using http client . And which method of approach is easy and important/useful for building a framework .
@MANJUBALASAHANA
@MANJUBALASAHANA 6 жыл бұрын
Thanks so much Mukesh!! so much easy to follow.
@asmarazaq9122
@asmarazaq9122 4 жыл бұрын
Mukesh your videos are very informative indeed
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thank you Asma 😀 and I am going to try your paneer recipe from your channel.
@asmarazaq9122
@asmarazaq9122 4 жыл бұрын
thts so nice of you
@desertstar7664
@desertstar7664 5 жыл бұрын
Cool tutorial, very straight forward to follow. Thanks Mukesh !
@khushbookapoor1968
@khushbookapoor1968 6 жыл бұрын
Thanku so much mukesh for posting this video..I will look into this.Really thanks
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Most welcome Khusbhoo
@MrBalavenkatesh
@MrBalavenkatesh 6 жыл бұрын
Hi Mukesh. I am getting io.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder parseResponse WARNING: Could not parse content-type: Response does not have a content-type header.. Can you please help me how can i overcome this error?
@sudiptamohanty8385
@sudiptamohanty8385 3 жыл бұрын
Thankyou so much. gone through so many tutorials finnaly this worked thankyou so much.
@vittal89
@vittal89 4 жыл бұрын
Hello Mukesh, Consider an example of Creating a User , Reading , Updating and Delete the User Information. On Creating the User , I will be getting a unique ID dynamically as a repsonse for the user which will be used for the consequent Read,Update and Delete request. My question is on having a data file with the details , I want to perform these operations in sequence by using the dynamically created response as a input value in my consecutive request for a single sequence CRUD operation and for the bulk CRUD operation. Is this possible in Rest Assured.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
HI VIcky, yes it is possible with RestAssured. If you have any sample API then I can record video and send you. Approach 1- This is called api chaining where one API will pass data to another API. I have show similar example in this video.kzbin.info/www/bejne/pmmUdXaYqrVlp80
@kushanchoudhury1942
@kushanchoudhury1942 6 жыл бұрын
Hi Mukesh, Please share some more videos on Rest API.Awaiting for your latest videos eagerly.
@asif.mammadov
@asif.mammadov 6 жыл бұрын
Hi Mukesh. Thank you for the video! I am very new to RestAssured and I want to use it to automate the API service I am developing. From my understanding the framework does a live testing against up and running API service. Is there a way/approach to use RestAssured testing during build time ? Similar to how JUnit tests run when you build your project using maven. If that is not the case, I was wondering how people use RestAssured in production environment. I would love to hear your thoughts!
@nithyadevabhaktuni6712
@nithyadevabhaktuni6712 3 жыл бұрын
Hi, Can i know how to record a value from the response body and parameterize it to use it in next API. [Selenium ]
@JitendraKumar-lr3vq
@JitendraKumar-lr3vq 5 жыл бұрын
hi mukesh , i am a regular follower of your videos,your videos are very easy to learn and interactive. could you please make video on gradle installation and integrating gradle with jenkins. gradle is used nowadays frequently please make vdeo on gradle.
@shellysharma4397
@shellysharma4397 6 жыл бұрын
Thanks a lot for posting this. AWESOME VIDEO.
@santosh830
@santosh830 6 жыл бұрын
I don’t understand why there is a dislike for this video☺️
@rahulhonashetty2120
@rahulhonashetty2120 3 жыл бұрын
Hi Mukesh I think PUT http method also create additional load on server. Because if we want to edit some resource which is not available in server than PUT will first act as POST than act as PATCH. (i.e., It will create resource and than edit the resource) correct me if i am wrong
@kellykessler3294
@kellykessler3294 6 жыл бұрын
Hi Mukesh, Again tanks, I think we should avoid double citation("") while trying to post any int value like id, am I right ?
@krishnasamy3967
@krishnasamy3967 5 жыл бұрын
hi @Mukesh - How to make series of API calls from a base API using response data from the base API. Eg: API1 is base API, the response data from API1 will be used as input for API2, API3 and those API`s will be called in parallel or series. Pls advise.
@stephenshinde3502
@stephenshinde3502 6 жыл бұрын
Hi Mukesh, Thanks for making videos on this topic I have one doubt regarding PUT method { "device": { "appVersion": "1", "authorization": "Basic ", "customerId": "12", "deviceId": "123", "deviceName": "Samsung SM-N900", "deviceType": "1", "X_Per": "zZD/h", "isPassword": "0", "language": "1", } } How to write above Response into JSON formate
@utpalkumar3
@utpalkumar3 5 жыл бұрын
Hey @Mukesh, don't you think "json.simple" dependency is little old (Last released in 2012). is it still in used? or any new alternative is there so we can use that. Videos are great by the way. Thanks
@santosh830
@santosh830 6 жыл бұрын
Mukesh, does geckodriver work with firefox version 58.if so which version should I use for the gecko driver. Thanks for your effort in training us .
@maheedharkolipakula9222
@maheedharkolipakula9222 4 жыл бұрын
Tq Mukesh sir . explanation is soo nice
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thanks Maheedhar
@maheedharkolipakula9222
@maheedharkolipakula9222 4 жыл бұрын
@@Mukeshotwani please do cucumber bdd framework videos
@15nupursingh
@15nupursingh 4 жыл бұрын
Hi..do we have session of api automation with cucumber
@sharmilaraj6476
@sharmilaraj6476 5 жыл бұрын
Hi Mukesh, Thanks for Sharing this video!.I m getting "Failed to parse Json document" when i use Json object in my POST method.COuld you please help!
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Hi Sharmila, it means payload is not proper. JSONObject will only work when you have valid payload.
@abubakarshaik4688
@abubakarshaik4688 5 жыл бұрын
Hi Mukesh thank you for sharing your knowledge ... Please make video how to get data specific data in json body
@oneplanet007
@oneplanet007 6 жыл бұрын
I appreciate to visiting on your channel now I am following you I am still beiggenr tester if I getting bother I will ask you please guide me Mukesh Bhai
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Anytime bro. Please send all queries to mukeshotwani@learn-automation.com
@abhaypratapsingh4526
@abhaypratapsingh4526 4 жыл бұрын
Hi @mukesh Do you have any video with post api having complex body means jaon inside jaon type body ,how we need to put for those body
@Deliquesent
@Deliquesent 4 жыл бұрын
Hi, could you please share the link for all topics in API testing covered in your tutorial?
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Sakshi, here is the link kzbin.info/www/bejne/r6u8XmiGhLVprrs
@appupruthvi8558
@appupruthvi8558 6 жыл бұрын
Hi Mukesh, did you posted any video related to oauth handling in rest assured. If yes, can you please give us the video link.
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Not Posted yet.. Pruthvi
@appupruthvi8558
@appupruthvi8558 6 жыл бұрын
Hi Mukesh, Thanks for your replay. When are u planning to post the same?
@VamsiKrishna-og1zu
@VamsiKrishna-og1zu 6 жыл бұрын
Hi Mukesh, nice video. Any one of your other videos covering how to fetch response in run time?
@krishnapandit6065
@krishnapandit6065 6 жыл бұрын
Hi Mukesh ur videos was very helpful, Can u make video for Multi-part form data too Thanks
@theharshaankalgi
@theharshaankalgi 3 жыл бұрын
Awesome Brother, God Bless.
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thank you Harsha 🙏
@saquibhelal7477
@saquibhelal7477 5 жыл бұрын
Can you tell why here we use RestAssured.given() and can you please some more video on Rest Assured Api Testing
@ashishkumarmishra2346
@ashishkumarmishra2346 4 жыл бұрын
Hi Mukesh...After updating data using the PUT method how can we validate whether data is updated or not? Like you updated the author to "Mukesh Otwani" so how to validate from response? Aprt from status code..
@sriramkukkadapu
@sriramkukkadapu 4 жыл бұрын
You need to do a get and validate
@ankitshrivastava1772
@ankitshrivastava1772 4 жыл бұрын
Hello Mukesh, How to pass Params in any GET or POST call, as we pass in the Postman . Please help.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Sure Ankit, I will record video on this. In the meanwhile you can pass parameter using below post www.baeldung.com/rest-assured-header-cookie-parameter
@LifeinSoBo
@LifeinSoBo 4 жыл бұрын
Put and POST operations should go together always ?
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Soma no its not mandatory because post and put both serve different purpose. Post- will create new resource in server like create a tweet, post or story whereas put will update the existing resource on server like change or update the description of uploaded photo, post or story.
@raunaqt90
@raunaqt90 4 жыл бұрын
@@Mukeshotwani if we consider DB. put = update and post = insert.
@tarikgulsever5191
@tarikgulsever5191 4 жыл бұрын
great explanation, how about using object mapper from jackson library .
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Tarik, yes I have used in this video kzbin.info/www/bejne/r6u8XmiGhLVprrs
@shreerangakv7183
@shreerangakv7183 6 жыл бұрын
Hi Mukesh, my API only accepts " x-www-form-urlencoded" body only , but i am not getting how to send the body in that format particularly using unirest please help
@rajeevkommana1990
@rajeevkommana1990 6 жыл бұрын
thanks so much Mukesh
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Glad you liked it Rajeev
@gasparottogui
@gasparottogui 6 жыл бұрын
Great video, thanks Mukesh.
@prachijoshiporwal3353
@prachijoshiporwal3353 5 жыл бұрын
How we can send the request body through rest assured if its raw and text?? Not given contenttype in header for me its giving me 400 bad request because request is going null if i am simply reading request body from textfile. jsonobject wont work here
@AlokKumar-km6pi
@AlokKumar-km6pi 5 жыл бұрын
What if I need to send different data multiple time ?....Like for first iteration i want to post name as "Alok" and for next "Rahu'"? Can we get the data from excel sheet ?
@mandarthamke9779
@mandarthamke9779 3 жыл бұрын
@mukesh I have some doubt on api automation I need to automate api which hosted on AWS Mock service But not exactly getting proper solution But same api I can automate when it is hosted on developer local machine Pls guide Or any example that you can share
@shreyasb.s3819
@shreyasb.s3819 6 жыл бұрын
Thanks a lot Mukesh
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Most welcome Shreyas
@sauravmahata2401
@sauravmahata2401 6 жыл бұрын
json-server --watch db.json says 'json-server' is not recognized as an internal or external command, operable program or batch file. what to do?
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Install node js
@joydeepguha32
@joydeepguha32 3 жыл бұрын
For me node.js is also installed
@charubhardwaj8059
@charubhardwaj8059 5 жыл бұрын
Hi mukesh , How to send below body request in json put {"service":"pentest_appsec", "ticketing_system":"jira", "requester":"chbhardw", "issues":{ "service_queue":[ { "product":270, "queue":"ABC" } ], "customfield_21701":"bhsingha", "customfield_21700" : "chbhardw", "issuetype":"Bug", "splc_priority":"R1", "summary":"test", "fixVersions" :"2019-Q2", "duedate":"2019-12-16" } } i can use any other
@shanjaynithin2388
@shanjaynithin2388 4 жыл бұрын
Hi Mukesh, I am getting the following exception. Kindly help. java.lang.IllegalArgumentException: Don't know how to encode {"author":"api testing","id":"30","title":"selenium"} as a byte stream. Please use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type. For example: "given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs("applicaton/json", ContentType.TEXT))). .." at io.restassured.internal.http.EncoderRegistry.encodeStream(EncoderRegistry.java:132)
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Shanjay, please share your code then I can guide.
@shanjaynithin2388
@shanjaynithin2388 4 жыл бұрын
@@Mukeshotwani Hi Mukesh, Thank you so much for replying. I have used the same code used in the video. But still I get the error.
@xits
@xits 3 жыл бұрын
How could I validate if parameter field "title" is Null (empty) or not ?
@jayakumarnachimuthu6224
@jayakumarnachimuthu6224 6 жыл бұрын
Nice explanation
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Thanks Jayakumar 🙏
@akankshadubey4937
@akankshadubey4937 2 жыл бұрын
Hi Mukesh, I am unable to use JSONObject. it's simply not accepting it.
@vanikethineedi2854
@vanikethineedi2854 6 жыл бұрын
Thank you mukesh..
@manishayadav1877
@manishayadav1877 5 жыл бұрын
Mukesh otwani plz help me...I need it help in one post method I needs it post data and post inside another table how to do it plz reply.
@prabakarani7863
@prabakarani7863 5 жыл бұрын
Hi mukesh Please explain how to log/export the response/request details to the external files?
@bhadmusautomates
@bhadmusautomates 6 жыл бұрын
Hi Mukesh, I have a challenge. I have some apis to automate. The rest of the APIs depend on an access token response generated from a POST method. 1. How do I get this access token from the response? 2. How do I use this access token in other POST and GET methods using java and REST-assured? This is urgent please
@LifeinSoBo
@LifeinSoBo 4 жыл бұрын
Hi Mukesh, how to filter data we fetch ?
@srinivasanm9522
@srinivasanm9522 5 жыл бұрын
Hi Mukesh, how to logon 3rd party urls in html page? for example irctc.co.in, paytm, etc.. How to send post the username&password then submit, will go to destination link what we give in html page? Kindly guide me to achieve this.
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Hi Srini you need to get their official API's then you can make all API calls.
@MalluManish
@MalluManish 10 ай бұрын
Guru i am following as per your guidlines but i dont no where i am making mistaking ,i am getting this error "C:\Users\Mallukinnis>node -v v20.10.0 C:\Users\Mallukinnis>npm -v 10.2.5 C:\Users\Mallukinnis>npx -v 10.2.5 C:\Users\Mallukinnis>npm install -g json-server changed 55 packages in 6s 15 packages are looking for funding run `npm fund` for details C:\Users\Mallukinnis>json-server --watch db.json 'json-server' is not recognized as an internal or external command, operable program or batch file. sir where i need to make changes ...can you make video on this because many people getting the same error Guru.
@swapnilnagtilak101
@swapnilnagtilak101 6 жыл бұрын
Hello sir,can u make video on agile methodologies.actual o got lots of video related ti that but not getting proper concept of agile.so plzz can you make video on that also
@SunnyKumar-pw9ny
@SunnyKumar-pw9ny 4 жыл бұрын
Sir you are amazing.
@sharanyabhiram9242
@sharanyabhiram9242 4 жыл бұрын
Did anyone face this kind of issue.. When I am trying to create my post request using {"Id":"4", "title":"book", "author":"Chethan"} My response is showing in the below format { "title":"book", "Id":"4", "author":"Chethan"} I want my response same as the request I creaated.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Sharanya, order of fields does not matter here.
@amangiri6429
@amangiri6429 2 жыл бұрын
@@Mukeshotwani noted Thanks ! Actually , I was also facing the same issue but its resolved
@GabrielMutis-fk3jc
@GabrielMutis-fk3jc 6 жыл бұрын
Hi i'm trying to upload a csv file using rest assured O_O but i don't really know how to do it...when i'm doing it manually in swagger the curl displays it like this "file=@nameOfFileIwantToUpload.csv;type=application/vnd.ms-excel" -F "fileFormat="csv"" My attempt was to use the multiPart() method and inside to use new File(pathToMyFile) but i'm getting code 400...
@gagangill8831
@gagangill8831 4 жыл бұрын
thanks Bro, it worked.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Awesome
@ganeshchanti3841
@ganeshchanti3841 6 жыл бұрын
Hii mukes still any videos are there to learn
@ganeshchanti3841
@ganeshchanti3841 6 жыл бұрын
for automation
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Hi Ganesh, Yes there is so much to cover in API testing. check out the below link for list of topics learn-automation.com/api-testing-using-rest-assured-online-training/
@jajatikesharisahoo8628
@jajatikesharisahoo8628 6 жыл бұрын
great dude..........
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Thanks Sahoo Ji
@sheelasahoo4212
@sheelasahoo4212 6 жыл бұрын
Hi Mukesh,Request you to please help me on this issue: "java.lang.IllegalArgumentException: Don't know how to encode {"author":"Sahoo","id":"22","title":"json-server21"} as a byte stream. Please use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type. For example: "given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs("application/jason", ContentType.TEXT))). .."" the above issue occurs when i Perform POST and PUT.
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Hi Sheela, What is your exact requirement?
@shramanaroy7179
@shramanaroy7179 4 жыл бұрын
Hi Mukesh, For me it is failing saying Connection refused...please help
@vishalregister655
@vishalregister655 3 жыл бұрын
How can I find toJSONString method but it is showing only toString method.
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Hi Vishal, which are dependency you are using and which version?
@vishalregister655
@vishalregister655 3 жыл бұрын
@@Mukeshotwani Hello, I am using maven dependency and using latest version 4.3.3..
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Try adding below dependency io.rest-assured json-path 4.3.3
@vishalregister655
@vishalregister655 3 жыл бұрын
@@Mukeshotwani I am using same dependency.....but now problem is solved by using bdd process:: request=RestAssured.given().contentType(ContentType.JSON); request.when().body(json.toString());
@swatishilpa1136
@swatishilpa1136 3 жыл бұрын
@@vishalregister655 @mukesh Otwani - Did you get any solution for this problem?
@sudhanshukumar9441
@sudhanshukumar9441 4 жыл бұрын
Hi Mukesh, I am getting following exception while sending POST request: java.lang.IllegalArgumentException: Don't know how to encode {"author":"learn","id":"28","title":"selenium"} as a byte stream. Please use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type. For example: "given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs("application-json", ContentType.TEXT))). .." Code : public class Post_Put_DeleteExample { @Test public void test1() { RequestSpecification request=RestAssured.given(); request.header("Content-Type","application-json"); JSONObject json=new JSONObject(); json.put("id", "28"); json.put("title", "selenium"); json.put("author", "learn"); request.body(json.toJSONString()); Response response=request.post("localhost:3000/posts/"); int code=response.getStatusCode(); Assert.assertEquals(code, 201); } } Could you please help. Regards, Sudhanshu
@qeshquddus2709
@qeshquddus2709 5 жыл бұрын
Do you have a video how to automate Rest API on Cucumber BDD?
@amitbhardwaj7824
@amitbhardwaj7824 4 жыл бұрын
cool video keep uploading
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thank you, I will
@shubhrajitmohapatra2191
@shubhrajitmohapatra2191 6 жыл бұрын
Hi Mukesh I have doubt that selenium can automate shop.polymer-project.org/ this site or not. Please help me to solve because I'm try a lot of time but its not working by selenium.
@MrMadhur18
@MrMadhur18 6 жыл бұрын
yes selenium can do this....
@kellykessler3294
@kellykessler3294 6 жыл бұрын
Thanks for your effort, you are doing well but I think it's time to flip to IntelliJ IDEA
@engineers-blog
@engineers-blog 5 жыл бұрын
Sir i m getting response as "500" plz help me
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
For which scenario? You are getting 500 ?
@engineers-blog
@engineers-blog 5 жыл бұрын
@@Mukeshotwani post()
@engineers-blog
@engineers-blog 5 жыл бұрын
here is the code package Lifafa_Automation.Giftcard; import org.json.simple.JSONObject; import org.testng.annotations.Test; import io.restassured.RestAssured; import io.restassured.response.Response; import io.restassured.specification.RequestSpecification; public class GC_API { @Test public void test() { RequestSpecification request = RestAssured.given(); request.header("Content-Type", "application/json"); JSONObject jsonObject=new JSONObject(); jsonObject.put("paymentMode", "lgc"); jsonObject.put("lgcNumber", "7500037427390449");//send array type data request.body(jsonObject.toJSONString()); Response post = request.post("pre-payment-engine.goomo.team:443/payment-engine/api/v1.0.0/giftcard/vg-query-action"); int statusCode = post.statusCode(); System.out.println("Status code ="+statusCode); //Assert.assertEquals(statusCode, 201); } }
@engineers-blog
@engineers-blog 5 жыл бұрын
In postman i m getting 200 as status code
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
It should give 201, you can print log or debug
@AbhishekSingh-xy7kf
@AbhishekSingh-xy7kf 6 жыл бұрын
Hello Mukesh coding is simple and well understood but this is hard coded method we have to write entire set of codes everytime can you please instruct how to parametrize this method , Url i can but to supply body how i will do that. Will be waiting for your response.
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Hi Abhishek, Yes, we need to build the framework for the same. I have planned videos for the same will upload soon. Note- We have to use POJO Class for the same.
@AbhishekSingh-xy7kf
@AbhishekSingh-xy7kf 6 жыл бұрын
Thanks Mukesh will be waiting for the video. I have learnt entire selenium from your videos Great work Keep it up.
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Thanks Abhi : )
@sambhawjain2201
@sambhawjain2201 4 жыл бұрын
please send restassured interview question basic to indetail
@abraham2961
@abraham2961 6 жыл бұрын
Any real api for testing purpose where we can do all operation
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
Hi Rehan twitter and facebook provide all api developer.twitter.com/en/docs.html
@professionalwork509
@professionalwork509 5 жыл бұрын
cant open regres.in no use
@sachinindradasa9660
@sachinindradasa9660 5 жыл бұрын
reqres.in/
@towhidskynet
@towhidskynet 6 жыл бұрын
25:00
@pranalidhande1118
@pranalidhande1118 4 жыл бұрын
Thanks for your video. Can you please make video on how to automate POST with 'xxx-urlencoded form' contentType. I have the scenario where the grant_type, scope, username and password needs to be send in 'xxx-urlencoded form' for authentication. As well I need to send client_id and Client Secret with all the above details. Please help me in this regard. Thanks. Looking forward for your reply.
@swatishilpa1136
@swatishilpa1136 3 жыл бұрын
Hello Mukesh Sir, same here even i can't record the value of body as toJsonString - response.body(json.toJSONString());
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Hey Swati, I guess it solved by one of the comment. Thank you.
How to Handle Authentication in RestAssured
17:00
Mukesh otwani
Рет қаралды 48 М.
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 30 МЛН
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
How To Handle OAuth in RestAssured Framework
26:03
Mukesh otwani
Рет қаралды 26 М.
Build a Test Automation Framework with Python and Selenium
22:28
Thomas Janssen | Tom's Tech Academy
Рет қаралды 1,5 М.
REST Assured API testing Beginner Tutorial | Part 1 - Getting Started
44:39
Automation Step by Step
Рет қаралды 321 М.
29. Mastering Query Parameters in Rest Assured | REST API Testing Tutorial | API Testing Tutorial
13:13
How To Handle OAuth 2.0 In Rest Assured
24:51
Mukesh otwani
Рет қаралды 35 М.
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 30 МЛН