HP Service Test 11 – How to test a webservice Video

This is a 5 minute video of me showing how to test a web service using HP’s Service Test 11. This is my first attempt at a video post. Feedback – always appreciated!

Succeeding with Automation Awesomeness. I’ll show you how!

Test automation, like all development efforts, is difficult. Most projects don't succeed. You can do better! Sign up and receive exclusive content like my free 10 Proven Actionable Steps for Automation Awesomeness from some of the biggest testing leaders in the industry. Let me help YOU succeed with Test Automation! Sign up now:

Leave a comment:

49 comments
Malay - December 19, 2010

Hi Joe,

Nice to see the video on we services testing.I have office 2010,and I am having exporting tests from xcel to QC as it does nto support any addins,any thoughts !

Reply
    Joe Colantonio - December 20, 2010

    @Malay: Hi Malay – I’ve been using office 2008 so I have not seen this issue yet. If you can try to get your company to upgrade to Quality Center 11 it does have add-in support for Office 2010. Thanks for checking out the video — Cheers Joe

    Reply
Q - March 10, 2011

Hi Joe,

Thanks so much for the video! I actually used 9.0 when I was testing and this is so different I was lost when I installed it. After your video I have a clear idea of what to do in a short amount of time. Thanks again!

Reply
    Joe Colantonio - March 10, 2011

    @Q: I’m glad it helped! Thanks for checking by blog out :)

    Reply
Roopak - March 14, 2011

Hi Joe,

Currently we are using HP Service test 9.5 and in a few months time we will be using the new version i.e, HP Service test 11. I was wondering how different is the new ST with the old one. But now after watching the demo video, I understood the concept. Thanks for your fantastic video.

I have one query. In HP ST 9.5, instead of checkpoints, I can use user defined codes such as lr_xml_getvalues to do the checking and also for reporting I can use codes such as lr_output_string, can we have that options available in newer version. I know the new version is totally different from loadrunner vugen but what I want to know is whether I can write codes in HP ST 11. And if so, can you please let me know the place where we can write that.

Thanks in Advance, Waiting for your valuable comments.

Reply
    Joe Colantonio - March 14, 2011

    @Roopak: Hi Roopak – The lr_xml_getvalues equivalent in ST11 would be to use XPath (A query language used to identify a set of nodes within a XML document).
    The XPath Checkpoint option is located under the Checkpoints section in ST11. For lr_output_message, in ST11, under Toolbox\Miscellaneous folder
    there is a “Report Message” activity. The Report message will allow you to send a custom message to the ST report or a log file.

    If you need to create your own functions in ST11 there is also a “Custom Code” activity that allows you to write custom C# code.
    The documentation on this is pretty slim but I’ve been using it without any issue. Hope this helps. Let me know
    if you have any another question or any suggestion for future ST videos.

    Cheers,

    Joe

    Reply
John - March 24, 2011

Hi Joe !

The demo was very helpful to understad how service test works.
I am new to web services testing, can you point me to any good resources where I can learn how to test services in general ? then I can see how to leverage automation.

Another question, does service test integrate with Quality center ?

Cheers,
John

Reply
    Joe Colantonio - March 24, 2011

    John » HI John – that’s a good question – in general the same approach you use for normal functional testing would be the same for web service except unlike most application web services don’t have GUI user interfaces.
    I think the biggest hurdle for me to learn how to test web services was understanding the underlining technology that makes up web services like WSDLs. SOAP, SAO, XML. I found the web site w3school really helpful in learning about
    web services (http://www.w3schools.com/webservices/default.asp) and XML (http://www.w3schools.com/xml/default.asp). Another resource I found very helpful is the book “SOA for the Business Developer: Concepts, BPEL” by Ben Margolis

    Yes – Service Test 11.10 integrates with Quality Center just like QTP does. Also Service Test integrates with QTP.

    Thanks for your question!
    Cheers,
    Joe

    Reply
John - March 25, 2011

Hi Joe !

Thanks for the links and clarifying.

Have subscribed now to new content from your site :)

Cheers,
John

Reply
Pallab - May 12, 2011

Hi Joe,

I just wanted to know how we can change the end-point url automatically by scripting in HPST. I just need to run the script in different enviromnets and I want the script to take care of the change in end-point url.

Reply
    Joe Colantonio - May 20, 2011

    Pallab » Hi Pallab – I understand your issue, but I actually haven’t had to test the same web service against different env yet. I’m looking in to it now – if you find out before me please let me know. Cool Joe

    Reply
    Joe Colantonio - June 14, 2011

    Pallab » Hi Pallab – sorry for the late response (this was in my spam folder for some reason). If you have not figured this out yet this is what to do. In ST click on your web service in the canvas area. Under property sheet click on the ‘general’ icon. Under general there is a property named ‘Endpoint Address’. You can point that to a data source to automate using it against different environments. Hope this helps!

    Reply
Vijay - July 23, 2011

Hi Joe,

Currently I am using Webservice add-in for QTP automation , and I facing an issue while running the webservice–stating “The call failed. Exception from System. The system couldnt be resolved ‘Null’ …”
May i know if you can help on this, where the issue is.


Vijay

Reply
    Joe Colantonio - July 23, 2011

    Vijay » Hi Vija – I have not seen this error before. It sounds like a required field is not being passed in the web service request. Have you tried running in a free open-source tool like soapUI? That will help narrow down the issue to either QTP or an issue specific to your webservice. Cheer~Joe

    Reply
Susu - August 9, 2011

Hi Joe,
I am new one for ST, your video is very good, do you know which book to introduct detail ST, thanks a lot.

Reply
    Joe Colantonio - August 10, 2011

    Susu » Hi Susa – Unfortunately there are no books that I know of that cover Service Test. What I’ve been doing is using some C# books to help with
    ST custom code function. Also the HP Service Test tutorial is a good resource to get started with. Cheers~Joe

    Reply
      Susu - August 15, 2011

      your suggesting is good ,Thanks Joe

      Reply
Susu - August 15, 2011

I have problem, can you help me.

Not effective about SetVariableValue

Steps:
1) Define two User Variables: reUserVar and reUserVar1 in the Profile.
2) I drag ConcatenateStrings Activity into the testflow, and set its Prefix to relate reUserVar, its Suffix to relate to reUserVar1:
//auto-generated
ConcatenateStringsActivity4.Prefix = @”{ENV:UserVar}”;
ConcatenateStringsActivity4.Suffix = @”{ENV:UserVar1}”;

3) Define ConcatenateStringsActivity4_OnBeforeExecuteStepEvent:
var activity = ((HP.ST.Ext.BasicActivities.ConcatenateStringsActivity)(args.Activity));
activity.Context.TestProfile.SetVariableValue(“UserVar”,”Hello,”);
activity.Context.TestProfile.SetVariableValue(“UserVar1″,”World!”);

4) Check report: Prefix and Suffix are “”

Reply
Susu - August 15, 2011

Hi Joe
your VIDEO is very usesful and looking forward to your Video about Call Java Class.

Reply
Naresh - November 11, 2011

Hello Joe, Thank for the video it was really good!
Do you have any video which can show integration between Service Test 11.0 and QC11. Can you please share the video or related information, if you have. Thanks in advance!

Reply
    Joe Colantonio - November 18, 2011

    Naresh » Thanks Naresh – I’m glad you liked the video. For the ST 11 & QC video is there anything specific you would like to see – or just how to run ST from QC? Cheers~Joe

    Reply
Naveen - December 7, 2011

Hi Joe,

A good Intro video on how to test webservices using HP ST 11.
Do yo have any frequently used C# custom code snippets for HP ST 11.How will you do a checkpoint validation using Customcode activity?

Thanks
Naveen

Reply
    Joe Colantonio - January 13, 2012

    Naveen » Hi Naveen – if you use the args object there is a Checkpoint and Assert objects that allows you to create custom checkpoints. The appendix in Service Test User Guide (pg. 518 ST 11.20) has the exact steps to follow.Cheers~Joe

    Reply
Naveen - February 7, 2012

Hi GREAT video !

Would really appreciate if you could make a video on the Xpath validation using the new service test tool !

Thanks in advance !

Naveen.

Reply
    Joe Colantonio - February 9, 2012

    Naveen » Thanks Naveen! I will try to create a Xpath video soon! Thanks for the blog idea!!Cheers~Joe

    Reply
Sachin - March 24, 2012

Hi Joe,

I am using ST 11.10, there I am facing issue while connecting to QC 10. Below are the details of what steps I followed:
1. As suggested in User Guide I have made ALM/QC connection.
2. Imported Test case to QC 10
3. Tried to Run it.

But I am getting below error:
“Not able to open command object, contact your site administrator…….”
Please provide me solution for this.

Thanks !

Reply
    Joe Colantonio - March 30, 2012

    Sachin » Hi Sachin – First it is highly recommended that you upgrade to ST 11.20 and install Patch SOAST_00067. This has resolved a bunch of issues for me. Let me know if this helps. Cheers~Joe

    Reply
Naresh - April 16, 2012

Thanks Joe for the video.I am able successfully replay the example you showed in the video.I want you to post more videos on service test for web services testing.

Reply
    Joe Colantonio - April 16, 2012

    Naresh » Cool– Glad to hear Naresh! I will try to post more on ST.

    Reply
Thomas - April 19, 2012

Hi Joe,

Thanks for the videio , very useful.. Is there a way we can output the webservice output to the data table excel sheet)

thanks

Thomas

Reply
Naresh - April 20, 2012

Hi Joe,

I want to test a real time web service rather than a sample flight application. When i load a real time web service like “http://www.konakart.com/konakart/services/KKWebServiceEng?wsdl “, HP service test is throwing an error saying “Unable to connect remote server”. Can you please help me out on this?

Reply
Naresh - April 23, 2012

Hi Joe,

I am able to solve the issue.After installing 11.20, i am able to load the wsdl files. Earlier i was working on 11.00.

Cheers

Reply
Sushil - August 6, 2012

Hi Joe,

Could you please let me know how we can automatically create checkpoints for number of elements returned from database (Select Data).

For ex. Database query returns 5 rows. Now I want the webservice call to automatically create checkpoints for all 5 elements returned from the DB query.

Thanks in advance.

Best Regards,

Sushil

Reply
    Joe Colantonio - August 14, 2012

    Sushil » When you run a Select Data operation in ST you can also specify Checkpoints for the expected row/columns. For example in the Property Sheet of the Select Data click on the ‘Generate Ouput’ button. Next look under the checkpoints section your Result Table should have the 5 rows returned by your query. Expand each row will show you all the columns returned for that row. Check the column name you want to verify and enter the Expected Value. You can do this for all 5 rows. Does this answer your question?

    Reply
Ramyaa Seetharaman - August 22, 2012

Hi Joe,

I have status blocks with a set of tags status code, status and status desc. returned a number of times in my response xml. I would like to validate the presence of a specific combination of these tag (ex.) status code = 16,status = error, ststusdesc = operation invalid. How can I validate this combination in a array of the status block?

Thanks in advance.

Regards,
Ramyaa Seetharaman.

Reply
Santosh - September 6, 2012

Can we integrate ST 11 with QTP 10 ?

Please update……………..

Reply
sahi - October 26, 2012

Hi,
I am using HPST(11.2). I am new to this tool. When i tried executing some wsdl’s in response i am getting an error as :”Structural CheckPoint failed : Trying to get XmlNode for Xpath: /*[local-name(.)=’Envelope’][1], XmlNode was null”. As per my understanding i have given all proper inputs,Can you please help me out

Reply
    Joe Colantonio - November 14, 2012

    sahi » Hi – did you figure this out yet? Under the property sheet for your service operation, under checkpoints, make sure that the “Validate structure’ is not checked. Also are you seeing this bahavior when running from QC 10? I know that the latest ST path 7 resolved a QC 10 misreporting the same error for ST test. Either way make sure that you also have the latest ST path installed

    Reply
Rajiv - November 12, 2012

Hi Joe,
Thanks, for the nice tutorial to test the wsdl webservice, by fallowing your tutorial, I had created a test in HPST to verify the information returned by the web service & I was able to verify the data by putting the check point in the script but when I try to see it result viewer, which gets launched after test passed, it is not showing the details information as your test result in which you were able to drill down to check point leve, in my test it just say that the test is passed.

Please help me to understand, is there any setting in HPST to enable to see the result in detailed level in result view

FYI.. I am using HPST 11.2.1723

Thanks,
Rajiv

Reply
    Joe Colantonio - November 14, 2012

    Rajiv » Hi Rajiv – not sure why this is happening. If you go into HP Result Viewer and click on View>Restore Layout do you see the expected results?

    Reply
Kusum - October 22, 2014

Can we test Bus service request and response using UFT?

Reply
Click here to add a comment

Leave a comment: