VuGen — WebHttpHtml_Login.usr
Vuser Script Editor
1Action()
2{
3 lr_start_transaction("Login_Flow");
4
5 web_url("home",
6 "URL=https://shop.acme-corp.com/index.jsp",
7 "Resource=0",
8 "RecContentType=text/html",
9 LAST);
10
11 // Submit the login form
12 web_submit_data("login.jsp",
13 "Action=https://shop.acme-corp.com/login.jsp",
14 "Method=POST",
15 ITEMDATA,
16 "Name=username", "Value=john_doe", ENDITEM,
17 "Name=password", "Value=Passw0rd!", ENDITEM,
18 LAST);
19
20 web_add_header("X-User-Id", "884213");
21 lr_output_message("Session opened for john_doe");
22
23 web_custom_request("profile",
24 "URL=https://shop.acme-corp.com/api/profile?user=john_doe",
25 "Method=GET",
26 LAST);
27
28 web_submit_data("checkout.jsp",
29 "Action=https://shop.acme-corp.com/checkout.jsp",
30 "Method=POST",
31 ITEMDATA,
32 "Name=buyer", "Value=john_doe", ENDITEM,
33 LAST);
34
35 lr_end_transaction("Login_Flow", LR_AUTO);
36
37 return 0;
38}
Step 1 of 8 — select the hardcoded value john_doe, then right-click it to open the context menu.
ReadyParameters: 0 · Replaced: 0