参考懒猪的方法
方法:对于二级域名,重新创建session,并且加入登录cookies.
case1
[Tags] test
${headers}= Create dictionary Content-Type=application/x-www-form-urlencoded
Create Session rfs http://www.robotframework.net
${login_info} Set Variable {'user_name': 'lanzhu', 'password': '123456'}
${dic_data2} evaluate dict(${login_info})
${login} Post Request rfs /account/login data=${dic_data2} headers=${headers}
Log Many ${login.content}
Create Session rfs-article http://article.www.robotframework.net headers=${headers} cookies=${login.cookies}
${search_info} Set Variable {'v_sn': '1.3.0','os': '', 'search': '搜索','pageid': '50'}
${search_info2} evaluate dict(${search_info})
${res} Post Request rfs-article /publish/article data=${search_info2} headers=${headers}
Log Many ${res.content}
网友评论