How to test REST API that requires session_id
♥ 0 |
I have to test a REST API with JSON content. This API requires that the client login first and get a session id. I tried doing this with web_custom_request…but to no avail. This is the sample web_custom_request: web_custom_request("RestAPI", "URL=https://{severname}/rest/blablabla", "Method=POST", "TargetFrame=", "Resource=0", "Referer=", "Mode=HTTP", "RecContentType=application/json", "EncType=application/json", "Body={REQUEST_JSON_PARAM}", LAST); Questions are: 1) If I were to add code to the LoadRunner script and able to extract the session id, how do I pass it to the web_custom_request? Do I use web_add_cookie? Or do I use web_add_header? If so (whether web_add_cookie or web_add_header or any other), what’s the syntax? 2) Or am I doing this all wrong. What other ways can I test this REST API (with JSON)? I’m using LR 9.5
Marked as spam
|