Hi, now we have created some object repositories. And we will see how to create test cases for those object repository. Let us create two different test cases. One is for Lister users and to create new users, we lump these two together in one single test case and create another test case for IMG with HTTP at that request. Let me go to test cases and right click New Folder and I am going to create test cases for list and create users And another folder and creating for IMG you are sorry. Here, let me create on test case list users providing the name as list users and a click OK. Now, our test cases created Here, you can create test cases in manual method, script method.
And also you can pass variables in your test cases, which we will discuss later. Let us begin with manual method. Select manual method and go to add web service keyword and click the plus icon. Initially what we are going to do is, we will be sending a request from the drop down select Send request and in object select which request we need to send and double tap on object and select there I'll select the ad request From objected posturing, now, we have created SDKs for list users. So I am selecting this list all user object repository and I am giving Okay. Now, I will be sending request for this and go to script method.
A script will be automatically created to send a request to the list all users API request and go to manual method. Add a web service keyword to verify whether the status code of the web service response is 200 or not. If the status code response is 200, then the test cases passed in generally RLS it will be Fate. So, here we help to verify what is the status code of this web service read request. From the drop down, select, verify their response status code and input. We have to give the value as 202 easy way to go to this script method.
To do it easily go to script mode and the provider variable for API request. Where one sequel to know I am storing that web service request in one variable called variable one And I am parsing this var one variable here and I am verifying whether its request response has value 200 or not. I am saving it. Let us run this test case. Now our test case is launching the right side you will see the job progress. Initially it will take a little bit few seconds to launch our test case.
Let us wait No our test case started running. Hi guys no over test cases ran I found one issue. So, there is one small change instead of the providing this code in verifying the status value, we have to pass this code like Ws dot verify response status code and we have to pass this variable value here and here we need to provide whether the status response is 200 or what. Now, let us run this I am saving it and I am running now our test case is running in log viewer we will see the luck Yeah, he had a descending request no and it verified their status code. And now our test cases passed by verifying response status code successfully. If you go to manual method script will be also create manual script will also be created automatically for that.
The easiest way is to doing it by script method. You just by using manual method, you just send click Send request under select the object from object repository and go to script I say name variable to it by providing Dave def variable define any prior here pro add value in a moto artists. Here we have provided variable and we can also providing any custom name like list users or whatever relevant name you provide and line this and write this small line and pass the defined variable here. Save it. Now our test case is created, it will send the request and verify whether the status code is 200 or not. Let us check the don'ts again.
It started running Yeah, this very fit. Like that. We will create test cases for create users and IMG or APA as well.