VIDEO – How to test a web service using HP’s LoadRunner

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:

28 comments
Aravindd - March 14, 2011

I am going thru your video and I have HP Loadrunner 11 trial installed and was trying to use this url to import http://localhost:24240/HPFlights_SOAP?wsdl
getting this error

can not fetch WSDL data: http://localhost:24240/HPFlights_SOAP?wsdl
The specified WSDL may be incompatible with the selected toolkit.
Try using a different toolkit

My localhost is up and running. I pinged and tested.
Is there anyway to get around this are is there any other url I can try to practice.
Appreciate your help.

Regards
Aravind

Reply
    Joe Colantonio - March 14, 2011

    @Aravindd: I usually get that error if I try to import the WSDL when the application is not running.
    For the video example the web service I’m using is a sample flight application that came with HP Service Test 11.  If the sample flight application is not running and I try to import the WSDL I get the same error. Make sure you have the sample application up and running. If you don’t have the sample application you can get it by downloading HP’s Function Testing 11 eval from:

    https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-127-24^1352_4000_100__

    Hope that helps.

    Cheers,

    Joe

    Reply
Aravindd - March 14, 2011

Hi Joe,
Thanks for the reply.
I have Loadrunner 11 Eval Version installed, and it came HP Web Tours App. The webserver(localhost) is started and the application is up and running. Why cant I use that App. Doesnt it come with the WSDL’s.
Or did you use the HP’s Function Testing 11 eval’s Application instead of HP Loadrunner eval’s App and used Loadrunner webservices to import the wsdl. Please explain.

Regards
Aravind

Reply
    Joe Colantonio - March 14, 2011

    @Aravindd: Sorry for the confusion – I’m not using the flight application sample that came with LR (that is a web app). I’m using the Sample Flight application that came with HP’s Functional test tool “Service Test 11′ which is a “web service” version of the flight application. I then used Loadrunner’s Web Service protocol to import the ServiceTest WSDL. You could also take a look at : http://www.webservicex.net/ws/wscatlist.aspx for other webservices to try.

    Reply
Aravindd - March 14, 2011

Hi Joe,
Thanks for your immediate response.
I will install HP Service test 11 and try the LR and let you know.

Regards
Aravind

Reply
Joel Wingert - April 26, 2011

Hi,

No offense, but…

I tried using this video to learn the lr_xml_find function, but it’s way to blurry and the video cuts out a few important phrases, such as exactly what string are you using for the Xpath. The video cuts that part of the audio out, and the video is too blurry to see what you are putting in there.

Joel

Reply
    Joe Colantonio - April 26, 2011

    Hi Joel – Sorry about that – let me dbl check and make sure I posted the right video— I’ll create a new video if the current one somehow got corrupted. Thanks for the feedback!

    Reply
    Joe Colantonio - April 26, 2011

    Joel Wingert » Unfortunately is looks like I delete the original pre-edited video. It may take me a few days to redo. The code for the LR_XML_Find that I used for the video is:

    lr_xml_find(“XML={CreateFlightOrder_101_Response}”,
    “Query=CreateFlightOrderResult/TotalPrice”,
    “Value=125″,
    LAST);

    Reply
Joel Wingert - April 26, 2011

Ok thanx much… Sorry if I sounded brash… It’s just the way it came out, so to speak, but no ill was intended…

Reply
madhuri - August 29, 2011

Hi,
I feel the video is not so clear and also felt the screens turned so fast which is a little hard to follow for beginners.So when u update ur next video make sure u go slow and clear.

Thank You so much for ur help!

Reply
    Joe Colantonio - August 29, 2011

    madhuri » Thanks for the advice madhur! I’ll keep it in mind next time I post a video. I try to keep my videos under 5 minutes so I think that is part of the problem. Also my newer video’s picture quality should be better. Cheer~Joe

    Reply
Shrenik - September 27, 2011

Hi,
I am scripting for 2 way SSL web service scripting. I can open WSDL URL in IE after giving private key.
While trying to import WSDL in LR 11, I am getting error saying “the specified wsdl may be incompatible with the selected toolkit”.

Regards,
Shrenik

Reply
    Joe Colantonio - September 27, 2011

    Shrenik » Hi Shrenik – rather than try to import the WSDL have you tried to use the ‘Import Soap’ feature instead?

    Reply
lokesh - October 2, 2011

How to define Fast query path in XML-find or Get XML values

Reply
Dipak - January 25, 2012

Hello Joe,
Thanks for the vedio. I have imported the WSDL file. The payload for this WSDL looks like below. When I import it the values I see in LR as . Though I am able to execte the script with out any errors but message does not pass though. Your help is appreciated.


Reply
Rao Farhan - June 28, 2012

Thanks … Its really helpful

Reply
Manish - September 16, 2012

Hi Joe,

I tried the add webservice call in LR 11.5 and its working fine but when i try the same webservice in LR 9.5, its giving me error-

InvokeMethod failed- org.xml.sax.SAXException:Bad envelope tag: html
Details-Error while retrieving body- cannot parse output parameters.

Could you please help me in resolving this error.

Thanks,
Manish

Reply
    Joe Colantonio - September 19, 2012

    Manish » Hi Manish not sure why it would work in 11.5 and not 9.5. Do you have the latest patches for 9.5 installed? I did not find this as a known issue in HP’s KB.

    Reply
Vishal Saxena - October 9, 2012

Hello Joe,

I have resolved my issue to some extent. The error message I was getting earlier was due to misplaced “Mode=HTML”, “RecContentType=text/xml”.

Now, I am stuck with another error message “Error -26628: HTTP Status-Code=403 (Forbidden)”. I have also tried adding web_set_user(“username”,password”, host:port”); but still the request fails.
The request ask for its authentication when it is hitted on explorer.
Can you please suggest.

Regards,
Vishal Saxena

Reply
    Joe Colantonio - October 9, 2012

    Vishal Saxena » For 403 errors when using NTLM authentication try verify the following:
    1. Make sure that information in web_set_user is correct.

    Example:
    Assumptions:
    Username: usr
    Password: my_passwd
    Domain: spark
    Web server name: lazarus
    Port: 80

    Given the above, the function should be

    web_set_user(“spark\\usr”, “my_passwd”, “lazarus:80″);

    Note:
    The domain name “spark” followed by a double backslash must be appended before the username.
    NTLM Authentication is supported by Sockets Replay Engine (default) from LoadRunner 7.5 and above.
    Make sure that there are no special characters in the username/password. Special characters include (:;&*\”/#~,?{}$%|<>+.”@^()[]+-)\\.

    2. Try to add the following statement before the web_set_user function. This forces the connection to the server to a particular protocol rather than letting the server suggest one during the connection handshake:

    web_set_sockets_option(“SSL_VERSION”, “3”);

    3. Replay your script in the extended log with “Advance trace” to verify the information sent to your server. Then, compare the header request of the execution log with the one that was used during recording from the Recording Log (for Single Protocol) or Generation Log (for Multiple Protocol). If there is missing information, add it to the script using a web_add_cookie statement. For example, if you see “SMCHALLENGE=Yes” in the Recording or Generation Log, but not on the execution log, add the following to the script before the web_url request:

    web_add_cookie(“SMCHALLENGE=Yes ; path…; domain= …)

    Reply
Vishal Saxena - October 11, 2012

In addition to my earlier post , to share with you the error that is being thrown by the application is,
h2> Access is denied. \r\n
Action.c(19): \r\n
Action.c(19): \r\n
Action.c(19): \r\n
Action.c(19): Description: An error occurred while accessing the resources required
Action.c(19): to serve this request. The server may not be configured for access to the requested URL.\r
Action.c(19): \n
Action.c(19): \r\n
Action.c(19): \r\n
Action.c(19): Error message 401.2.: Unauthorized: Logon failed due to server configu
Action.c(19): ration.  Verify that you have permission to view this directory or page based on the
Action.c(19): credentials you supplied and the authentication methods enabled on the Web server.  C
Action.c(19): ontact the Web server’s administrator for additional assistance.\r\n
I even tried adding below statements,
web_add_header(“Host”, “server”);
web_add_header(“Authorization”, “username:password”);

Any help shall be appriciated.

Regards,
Vishal Saxena

Reply
    Joe Colantonio - October 11, 2012

    Vishal Saxena » Dumb question — but are you sure that you have the correct permissions for your username?

    Reply
Vishal Saxena - October 11, 2012

If it would have been, I might not have asked :). Surely, I am having those permissions, otherwise it would have failed doing manually also. Am I correct Sir? Thanks Anyways. Will update the error cause at your forum, once I resolve it.

Reply
Vishal Saxena - October 26, 2012

Hello Joe,

First of all, I would llike to share the reason for failure of my custom request as discussed in previous posts.
It was the authorization part, that was being incorrectly sent. Below was the resolution I found & it worked,
– Earlier I was using ,web_add_header(“Authorization”, lr_eval_string(“Basic {p_Username}””:””{p_Password}”));
which was WRONG.
The string {p_Username}””:””{p_Password} was encoded by base64 encoder, therefore passing the encoded string actually worked.
This was checked from SOAP UI HTTP Log.

Now, I am again stuck while making a test-run on Controller. Below are the RTS details-
Use Winlet replay engine instead of Socket engine (script fails using Socket)
Issue- Vusers does not increases beyond INIT state after 2-3 are on run, when I try to execute the same with localhost as agent, It ramps up to 20 vuser. This is a very strange behaviour, But I am actually stuck due to this.
Your advice might prove worth again.

Please help. Thanks in Advance Joe.
Regards,
Vishal Saxena

Reply
Bob - March 28, 2013

hello Joe,
i am try to set transaction pass and fail base on web service output value. i set web service output value as following

GetResult=result

then i put parameter in output message as following

lr_output_message(lr_eval_string(“{result}”))

here, i am having issue. where i am trying to set transaction pass or fail base on web service output of result.

if (lr_output_message(lr_eval_string(“{result}”)) == “APPROVE”)

lr_end_transaction(“XXXXX”, LR_PASS);

else
lr_end_transaction(“XXXXX”, LR_FAIL);

return 0);

can you tell me where am i making mistake in If statement? thanks

Reply
uft - October 31, 2013

Hello Joe,

How to parametrize the security Username & Passswords fields under HTTP tab for any API Test in UFT? Right now I can only enter a specific field value and I want to iterate it with multiple values.
In ST 9.5 I can use the web_set_user command for same.

Please assist.

Thanks.

Reply
javeed - January 16, 2014

Hi Joe,

I am unable to import the xml/wsdl files in Loadrunner and getting error as “The specified WSDL may be incompatible with the selected toolkit.Try using a different toolkit”. Please give me the solution to fix the above one.

Regards,
Javeed
javeed369@gmail.com

Reply
Click here to add a comment

Leave a comment: