Some time ago I made a little test comparing web services performance using HTTP GET and POST methods. I used the same script, in the same environment with the same web service. HTTP method was the only difference.
I discovered that POST method is twice much faster than request sent using GET method.
You should also know that request size with GET method can be limited, although RFC2616 says:
The HTTP protocol does not place any a priori limit on the length of
a URI. Servers MUST be able to handle the URI of any resource they
serve, and SHOULD be able to handle URIs of unbounded length if they
provide GET-based forms that could generate such URIs.
So if you are planning some web services performance testing or you want to speed up your tests a little bit before customer demo
you should consider POST HTTP method.
Small (basic) example howto test performance of Web Service using LoadRunner API.
Let say we have a web services that uses SOAP over HTTP. We want to check how fast we can send a request and receive a response. Because our service uses HTTP as a transport protocol, we are able to test it using simple HTTP Vuser script.
Here is the C code:
-
Action()
-
{
-
web_reg_save_param("Response","LB=", "RB=", LAST);
-
web_add_header("SOAPAction", "SampleMethod");
-
lr_start_transaction("REQ");
-
web_custom_request("Sample_Request","Method=POST",
-
"Mode=HTML",
-
"RecContentType=text/xml",
-
"EncType=text/xml; charset=utf-8",
-
"URL=http://example.com:1234/sample/",
-
"Body=<Envelope xmlns=\"http://example.com/sample\">\n"
-
" <Header/>\n"
-
" <Body>\n"
-
" <price><id>001</id></price>\n"
-
" </Body>\n"
-
"</Envelope>",
-
"LAST");
-
lr_end_transaction("REQ", LR_AUTO);
-
lr_output_message("Response is : %s\n", lr_eval_string("{Response}"));
-
return 0;
-
}
Have a fun…
Are you using proxy server to access your application? Do you store proxy username/password in VuGen Run-Time settings?
If yes, then be careful. LR stores your password as plain text on the disk!
Instead of Run-Time settings you can use web_set_proxy() function from API and encrypt your password there.
I’ve found it during playing with latest LR version. Steps to reproduce:
- Open controller
- Create new goal oriented scenario
- edit goal type and select “Virtual Users” goal
- set 0 (zero) as amount of Vusers to reach
- click OK
Done. LR crashes without any error message, without completely anything. And I thought boundary value testing is something basic… :/
P.S. This bug is already reported to HP.
Hello and welcome on Waldemar’s blog.