Absent Member.. Tayce Absent Member..
Absent Member..
119 views

service test--rest test question

Jump to solution

Hello,

Can you please kindly help please? For service test,

1. Can we create single checkpoint and apply it to Multiple results sets that are received (in the response body) as part of a request?

 

2. Count of the records returned in the Response Body (XML)? Can it be validated directly?

 

3.  How to look at the underlying script that is generated in Service test and ways to modify it (in order to insert logic in to it)?

 

4. RESTful service – How to set up authentication in the script for accessing the service?

 

Thank you!

Meifeng

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. MisterT1968 Absent Member..
Absent Member..

Re: service test--rest test question

Jump to solution

Dear Meifeng,

 

How are you? I hope you are fine 🙂

 

I have checked these points with a colleague, who is an expert in Service Test/API Testing.

 

1. It is not possible. When you import a WSDL, ST reads the expected format of the output and you create the checkpoints against them directly. There's no way of re-using the checkpoints.

 

2. We are not entirely sure, what you mean by this. What do you mean by count? You might be able to use the methods in the XML toolbox, like the "Validate XML" one.

 

3. Although it is not recommended (modifying the underlying script), it is possible. You can open the "TestUserCode.cs" file in the "Tests" pane, which is the C# script that is run, but it's not advised to modify it directly. You should use the activities in the toolbox like those in the "Flow Control" category to add logic to the script or you can write your own activities with the activity wizard.

 

4. You can add an HTTP header to the request and use it for authentication. For more details, please check the section "How to set HTTP headers for Web and REST services" from the user guide, which is provided as a PDF file.

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
0 Likes
2 Replies
Highlighted
Absent Member.. MisterT1968 Absent Member..
Absent Member..

Re: service test--rest test question

Jump to solution

Dear Meifeng,

 

How are you? I hope you are fine 🙂

 

I have checked these points with a colleague, who is an expert in Service Test/API Testing.

 

1. It is not possible. When you import a WSDL, ST reads the expected format of the output and you create the checkpoints against them directly. There's no way of re-using the checkpoints.

 

2. We are not entirely sure, what you mean by this. What do you mean by count? You might be able to use the methods in the XML toolbox, like the "Validate XML" one.

 

3. Although it is not recommended (modifying the underlying script), it is possible. You can open the "TestUserCode.cs" file in the "Tests" pane, which is the C# script that is run, but it's not advised to modify it directly. You should use the activities in the toolbox like those in the "Flow Control" category to add logic to the script or you can write your own activities with the activity wizard.

 

4. You can add an HTTP header to the request and use it for authentication. For more details, please check the section "How to set HTTP headers for Web and REST services" from the user guide, which is provided as a PDF file.

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
0 Likes
Absent Member.. Tayce Absent Member..
Absent Member..

Re: service test--rest test question

Jump to solution

Many thanks Tino 🙂

 

Meifeng

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.