1. Home
  2. Opkey Help
  3. 14. Working with Service Repository (Testing web services)
  4. 14.4 Executing Web services

14.4 Executing Web services

14.4.1 Executing Web Services (REST) using GET Method

  • Click on Add REST Service and provide URI.
  • Add Rest Method in Service.
  • Select GET http method.
  • Now, click on Run command button to execute web service of given URI.

  • The response contains two types of data: Response Data & Raw Data as shown in below screenshot.

Authentication Types: 

OpKey allows its users to test web services that need different authentication types. Here are the OpKey supported authentication types:

(For details about the authentication and its types, please refer: Authentication of Web Services)

 14.4.2 Executing Web Services (REST) using POST Method

  • Select POST http method.
  • Add required parameters.

Further, In parameters section, enter name (in Name column), path of the desired file (in Default Value column) under RequestBody parameter and check Is Argument, Is File check boxes. You also need to enter Name in RequestBody, choose Content Type corresponding to the selected file. Further, select nocheck and check ‘Is Argument’ check box under RequestHeader parameter so that you can put your file over desired application without facing any security related issue.

Now, you can execute this REST web service with Post method by using it into Test Case or Function Library. Here, we are executing given web service URI through Test Case. Click on Add Step to add new step and map it with the corresponding Service Repository (SR) file. Further, click on Run to execute it.

13

 

14.4.3 Executing Web Services (REST) using PUT Method

  • Create a Service Repository File
  • Click on Add REST Service
  • Enter web service URI and select Authentication type
  • Add PUT Method and select authentication type.
  • Enter authentication credentials corresponding to your Jira.

notePUT method is similar to the POST method which is used for updating given entries.

 

Enter Web Service URI, select Authentication Type, and enter Authentication credentials (Username & Password) of desired web application on which entry has to be updated with PUT method.

15

Add method by clicking on icon from tool menu & select PUT method from the dropdown list and then enter URI of desired web application. In parameters section, left name ‘Blank’ (in Name column), path of the desired file (in Default Value column) under RequestBody parameter and check Is Argument, Is File checkboxes. You also need to choose Content Type corresponding to the selected file. Further, select Token as nocheck and check Is Argument checkbox under RequestHeader parameter so that you can put your file over web application without facing any security related issue.

 

noteHere, Name is left as Blank because we just need to pick text from the selected text file by using PUT Method, unlike posting/uploading whole file in POST method.

 

16

Now, we need to execute this REST web service by using it into Test Case or Function Library. Here, we are executing given web service URI through Test Case. Click on Add Step to add new step and map it with the corresponding Service Repository (SR) file. Further, click on Run to execute it.

14.4.4 Executing Web Services (REST) using DELETE Method

  • Create a Service Repository File
  • Click on Add REST Service
  • Enter web service URI and select Authentication type
  • Add DELETE Method and select authentication type
  • Enter authentication credentials corresponding to your Jira

noteDELETE Method is used to delete selected Jira issue. Here, we will delete an object from the list of objects by using DELETE Method in REST WebService.

 

18

Add method by clicking on icon from tool menu. Here, you need to select DELETE method from the dropdown list and enter URI of Jira. In parameters section, enter Token as nocheck and check Is Argument checkbox under RequestHeader parameter. Under RequestBody parameter, you don’t need to enter any value because we are trying to delete an issue rather than post or put any value as well.

Now, execute this REST web service by using it into Test Case or Function Library. Here, we are executing given web service URI through Test Case. Click on Add Step to add new step and map it with the corresponding Service Repository (SR) file. Further, click on Run to execute it.

19

Was this article helpful to you? Yes No