https add_cookie问题
需求:模拟登陆系统,
第一步:GET请求,登陆url,获取sessionid和token
第二步:post请求,cookie为获取到的session和token,body为用户名和密码信息。
问题:第二步报404错误,cookie添加失败。求助大神我的问题出在哪里?
我得代码:
web_custom_request("login.html",
"URL=https://{ip}:4430/dashboard/auth/login/",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=https://{ip}:4430/dashboard/auth/login/",
"Snapshot=",
"Mode=html",
"EncType=text/plain; charset=UTF-8",
// "body={username=\"{user}\"&password=c2RnZmFzZGc%3D&csrfmiddlewaretoken=\"{csrftoken_1}\"}",
LAST);
web_add_cookie(cookie);
return 0;
错误信息:
Action.c(14): Continuing after Error -26627: HTTP Status-Code=404 (Not Found) for "https://199.201.90.31:4430/dashboard/auth/login/"
Action.c(14): HANDLE_CLOSING" on behalf of "URL="https://199.201.90.31:4430/dashboard/auth/login/"
Action.c(14): web_custom_request("login.html") highest severity level was "continue on error", 21 body bytes, 65 header bytes
Action.c(14): Continuing after error in Vuser script.
Action.c(25): web_add_cookie started
Action.c(25): Continuing after Error -27234: Adding the cookie failed
Action.c(25): web_add_cookie highest severity level was "continue on error"
Action.c(25): Continuing after error in Vuser script.
你这是qtp啊 lr? 这是LoadRunner中的问题,
首先检查 web_custom_request("login.html"。。。。
然后 web_add_cookie(cookie);,这样写不对,建议查一下语法!
https的吗 一开始不要参数化,有没有问题?
页:
[1]