With example for bot GET and POST
GET:
You will have a URL with all variables in it.
Test it manually in SOAP UI
Try to observe the difference in passed and failed transaction to add conditon in LR script
In Load Runner:
Take Protocol as Web HTTP/HTML
Get web_custom_request from View - Step Tool Box.
Put URL and Click OK.
Parameterize the variable in URL
web_reg_save_param("c_response","LB=","RB=",LAST);
web_reg_save_param("c_employeeName","LB=\"employee_name\":\"","RB=\",\"",LAST);
lr_start_transaction("Start_transaction_1");
web_custom_request("web_custom_request",
"URL=http://dummy.restapiexample.com/api/v1/employee/{p_EmployeeId}",
"Method=GET",
"TargetFrame=",
"Resource=0",
"Referer=",
"Body=",
LAST);
lr_end_transaction("Start_transaction_1", LR_AUTO);
POST:
You will have a URL with all variables in it.
Test it manually in SOAP UI
Try to observe the difference in passed and failed transaction to add conditon in LR script
In Load Runner:
Take Protocol as Web HTTP/HTML
Get web_custom_request from View - Step Tool Box.
Put URL, request and convert it in C format bt right click option
Parameterize the input variables
web_reg_save_param("c_full","LB=","RB=",LAST);
web_reg_save_param("c_id","LB=\"id\":\"","RB=\"}",LAST);
lr_start_transaction("POST_Transaction");
web_custom_request("web_custom_request",
"URL=http://dummy.restapiexample.com/api/v1/create",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Body={\"name\":\"{p_name}\",\"salary\":\"{p_salary}\",\"age\":\"{p_age}\"}",
LAST);
lr_end_transaction("POST_Transaction", LR_AUTO);
GET:
You will have a URL with all variables in it.
Test it manually in SOAP UI
Try to observe the difference in passed and failed transaction to add conditon in LR script
In Load Runner:
Take Protocol as Web HTTP/HTML
Get web_custom_request from View - Step Tool Box.
Put URL and Click OK.
Parameterize the variable in URL
web_reg_save_param("c_response","LB=","RB=",LAST);
web_reg_save_param("c_employeeName","LB=\"employee_name\":\"","RB=\",\"",LAST);
lr_start_transaction("Start_transaction_1");
web_custom_request("web_custom_request",
"URL=http://dummy.restapiexample.com/api/v1/employee/{p_EmployeeId}",
"Method=GET",
"TargetFrame=",
"Resource=0",
"Referer=",
"Body=",
LAST);
lr_end_transaction("Start_transaction_1", LR_AUTO);
POST:
You will have a URL with all variables in it.
Test it manually in SOAP UI
Try to observe the difference in passed and failed transaction to add conditon in LR script
In Load Runner:
Take Protocol as Web HTTP/HTML
Get web_custom_request from View - Step Tool Box.
Put URL, request and convert it in C format bt right click option
Parameterize the input variables
web_reg_save_param("c_full","LB=","RB=",LAST);
web_reg_save_param("c_id","LB=\"id\":\"","RB=\"}",LAST);
lr_start_transaction("POST_Transaction");
web_custom_request("web_custom_request",
"URL=http://dummy.restapiexample.com/api/v1/create",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Body={\"name\":\"{p_name}\",\"salary\":\"{p_salary}\",\"age\":\"{p_age}\"}",
LAST);
lr_end_transaction("POST_Transaction", LR_AUTO);
This is really a worthy and wonderful blog about Software Testing Companies in Chennai to read and further more tips on the Software Testing Companies in Bangalore have been learnt. thanks for sharing your views among us and its great time spending on this. I am waiting for new post here about Software Testing Services in Chennai and Please keep it up in future..
ReplyDelete