The script to the recording is as follows:
Login ()
{
Lr_think_time (10);
Web_url ("verifycode.jsp",
"Url=https://192.168.211.246:56661/portal/common/jsp/verifycode.jsp?codesource=loginverifycode&time= 1330596177343 ",
"Resource=1",
"Reccontenttype=image/jpeg",
"Referer=https://192.168.211.246:56661/portal/indexaction",
"Snapshot=t2.inf",
last);
Web_url ("192.168.211.246:38787_2",
"url=http://192.168.211.246:38787/",
"Resource=0",
"Reccontenttype=text/html",
"Referer=https://192.168.211.246:56661/portal/indexaction",
"Snapshot=t3.inf",
"Mode=html",
Extrares,
"Url=https://192.168.211.246:56661/portal/common/style/image/head/topbg_line.jpg", "Referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/shadowlw.jpg", "referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/tabm.jpg", "referer=https://192.168.211.246:56661/ Portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/tabbg.jpg", "referer=https://192.168.211.246:56661 /portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/shadowrw.jpg", "referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/titlehot.gif", "referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/head/contanta_pic_y.gif", "Referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/titlehot2.gif", "referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/shadowb.jpg", "referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
"Url=https://192.168.211.246:56661/portal/common/style/image/titlemyoder.gif", "Referer=https:// 192.168.211.246:56661/portal/indexaction ", Enditem,
last);
Web_url ("Subscribeinfoquery.action",
"Url=https://192.168.211.246:56661/portal/subscribeinfoquery.action",
"Resource=0",
"Reccontenttype=text/html",
"Referer=https://192.168.211.246:56661/portal/indexaction",
"Snapshot=t4.inf",
"Mode=html",
last);
return 0;
}
Think: Whether it is loadrunner does not support HTTPS
Resolution: By looking up some data, in fact LoadRunner support HTTPS protocol, but need to make some changes in recording script, the following steps:
1, the preparation of the certificate
The common certificate is: *.pfx format, which can be installed on Internet Explorer by double-clicking the certificate. Users can use them when they visit.
But this kind of certificate is not the type used by LoadRunner, so it needs to be converted. Convert it to *.PEM format.
The conversion method is as follows:
A) after installing OpenSSL
b) Run the OpenSSL binary file of the C:\<openssl>/bin folder, which will start the OpenSSL command prompt
C) Execute the following command: Pkcs12-in D:\test1.pfx-out d:\test01.pem–nodes
d) After execution, the Test01.pem file will be generated in the specified directory, which will be used when the next step is configured for LoadRunner.
2. LR Configuration
Start LoadRunner, open the recording option.
Picture
Notice the options in the Red box.
After selecting, click New Enty
Picture
The configuration in the red box is the IP and port number of the server, which can be configured according to the actual address required by the test .
Once configured, use specified client-side CERTIFICATE[BASE64/PEM] Hooks for access using client certificates.
Click... Select the client certificate that just converted the build.
Picture
If you have a password for the certificate, you also need to enter it here.
All configurations that are different from HTTP are complete.
After recording, you can see the LoadRunner newly generated statement at the beginning of the script
WEB_SET_CERTIFICATE_EX ("Certfilepath=test01.pem",//Key file
"Certformat=pem",
"Keyfilepath=test01.pem",//Key file
"Keyformat=pem",
"password=123456",//Key password
"Certindex=1",
last);
3. After completing the above two steps, the script can be recorded normally.
or use:
Test WebService Encounter HTTPS request, is to add web_set_sockets_option ("Ssl_version", "TLS") before the transaction begins;
LoadRunner Handling HTTPS Requests