${EXECDIR}\\DA_data.yaml Imports a variable file with the given path and optional arguments. ${num} random.choice(["139","188","185","136","158","151","132","156","189","187","135","134"]) random Evaluates the given expression in Python and returns the result. ${num} = 185 ${number} "".join(random.sample("01234567897",8)) random,string Evaluates the given expression in Python and returns the result. ${number} = 48157976 ${phone} ${num}${number} Evaluates the given expression in Python and returns the result. ${phone} = 18548157976 ${phone} Makes a variable available globally in all tests and suites. ${phone} = 18548157976 ${userid_list} Returns a list containing given items. ${userid_list} = [] ${Cheader_list} Returns a list containing given items. ${Cheader_list} = [] ${Aheader_list} Returns a list containing given items. ${Aheader_list} = [] Helper for quickly disabling all urllib3 warnings. dating ${${dating}.dating域名} ${${dating}.AHeader} Create Session: create a HTTP session to a server Creating Session using : alias=dating, url=http://dating-agency-api-test.qniao.cn, headers={'Content-Type': 'application/json', 'X-APP-ID': '50325897884795881'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 Creating session: dating ${data} { \ \ "account":"${phone}", \ \ "accountType":2, \ \ "captcha":888888 } Returns the given values which can then be assigned to a variables. ${data} = { "account":"18548157976", "accountType":2, "captcha":888888 } ${reps} dating /dating-agency-uec/authorize/by-captcha ${data.encode('utf-8')} Sends a POST request on a previously created HTTP Session. Starting new HTTP connection (1): dating-agency-api-test.qniao.cn http://dating-agency-api-test.qniao.cn:80 "POST /dating-agency-uec/authorize/by-captcha HTTP/1.1" 200 None POST Request : url=http://dating-agency-api-test.qniao.cn/dating-agency-uec/authorize/by-captcha path_url=/dating-agency-uec/authorize/by-captcha headers={'User-Agent': 'python-requests/2.15.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'X-APP-ID': '50325897884795881', 'Content-Length': '68'} body=b'{ "account":"18548157976", "accountType":2, "captcha":888888 }' POST Response : url=http://dating-agency-api-test.qniao.cn/dating-agency-uec/authorize/by-captcha status=200, reason= headers={'Server': 'nginx/1.16.1', 'Date': 'Sun, 07 Apr 2024 06:32:48 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers'} body={"code":0,"message":"successful","data":{"token":"iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==","userId":"974358220019732480"}} ${reps} = <Response [200]> ${code} ${reps.json()} code Returns a value from the given ``dictionary`` based on the given ``key``. ${code} = 0 ${token} ${reps.json()['data']} token Returns a value from the given ``dictionary`` based on the given ``key``. ${token} = iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag== ${userId} ${reps.json()['data']} userId Returns a value from the given ``dictionary`` based on the given ``key``. ${userId} = 974358220019732480 ${message} ${reps.json()} message Returns a value from the given ``dictionary`` based on the given ``key``. ${message} = successful ${login_header} {'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT ${token}','X-Organization-Id':'963432943739605555'} Returns the given values which can then be assigned to a variables. ${login_header} = {'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==','X-Organization-Id':'96... ${client_header} {'Content-Type':'application/json','X-APP-ID':'50325897884795880','Authorization':'QNT ${token}'} Returns the given values which can then be assigned to a variables. ${client_header} = {'Content-Type':'application/json','X-APP-ID':'50325897884795880','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag=='} ${userid_list} ${userId} Adds ``values`` to the end of ``list``. ${Cheader_list} ${client_header} Adds ``values`` to the end of ``list``. ${Aheader_list} ${login_header} Adds ``values`` to the end of ``list``. ${code}==0 Should Be Equal As Strings ${message} successful ELSE Should Be Equal As Strings ${message} 验证码错误或无效验证码,请重试! Runs the given keyword with the given arguments, if ``condition`` is true. ${message} successful Fails if objects are unequal after converting them to strings. Argument types are: <class 'str'> <class 'str'> ${userid_list} Makes a variable available globally in all tests and suites. ${userid_list} = ['974358220019732480'] ${Aheader_list} Makes a variable available globally in all tests and suites. ${Aheader_list} = ["{'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==','X-Organization-Id':'... ${Cheader_list} Makes a variable available globally in all tests and suites. ${Cheader_list} = ["{'Content-Type':'application/json','X-APP-ID':'50325897884795880','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag=='}"] ${login_header} Makes a variable available globally in all tests and suites. ${login_header} = {'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==','X-Organization-Id':'96... ${client_header} Makes a variable available globally in all tests and suites. ${client_header} = {'Content-Type':'application/json','X-APP-ID':'50325897884795880','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag=='} ${Aheader} Returns a list containing given items. ${Aheader} = [] ${userId} ${login_header} ${userid_list} ${Aheader_list} 974358220019732480 {'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==','X-Organization-Id':'96... Helper for quickly disabling all urllib3 warnings. dating ${${dating}.dating域名} ${login_header} Create Session: create a HTTP session to a server Creating Session using : alias=dating, url=http://dating-agency-api-test.qniao.cn, headers={'Content-Type': 'application/json', 'X-APP-ID': '50325897884795881', 'Authorization': 'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==', 'X-Organization-Id': '963432943739605555'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 Creating session: dating ${reps} dating /dating-agency-uec/user/list/own-organization params=userId=${userid} Sends a GET request on a previously created HTTP Session. Starting new HTTP connection (1): dating-agency-api-test.qniao.cn http://dating-agency-api-test.qniao.cn:80 "GET /dating-agency-uec/user/list/own-organization?userId=974358220019732480 HTTP/1.1" 200 None GET Request : url=http://dating-agency-api-test.qniao.cn/dating-agency-uec/user/list/own-organization?userId=974358220019732480 path_url=/dating-agency-uec/user/list/own-organization?userId=974358220019732480 headers={'User-Agent': 'python-requests/2.15.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'X-APP-ID': '50325897884795881', 'Authorization': 'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==', 'X-Organization-Id': '963432943739605555'} body=None GET Response : url=http://dating-agency-api-test.qniao.cn/dating-agency-uec/user/list/own-organization?userId=974358220019732480 status=200, reason= headers={'Server': 'nginx/1.16.1', 'Date': 'Sun, 07 Apr 2024 06:32:48 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers'} body={"code":0,"message":"successful","data":[]} ${reps} = <Response [200]> ${data} ${reps.json()} data Returns a value from the given ``dictionary`` based on the given ``key``. ${data} = [] ${message} ${reps.json()} message Returns a value from the given ``dictionary`` based on the given ``key``. ${message} = successful ${message} successful Fails if objects are unequal after converting them to strings. Argument types are: <class 'str'> <class 'str'> ${data}==[] log 未获取到组织信息! ELSE log ${data} Runs the given keyword with the given arguments, if ``condition`` is true. 未获取到组织信息! Logs the given message with the given level. 未获取到组织信息! ${admin_header} @{Aheader_list} {'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==','X-Organization-Id':'96... dating ${${dating}.dating域名} ${admin_header} Create Session: create a HTTP session to a server Creating Session using : alias=dating, url=http://dating-agency-api-test.qniao.cn, headers={'Content-Type': 'application/json', 'X-APP-ID': '50325897884795881', 'Authorization': 'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==', 'X-Organization-Id': '963432943739605555'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 Creating session: dating ${reps} dating dating-agency-uec/user/get/base-info Sends a GET request on a previously created HTTP Session. Starting new HTTP connection (1): dating-agency-api-test.qniao.cn http://dating-agency-api-test.qniao.cn:80 "GET /dating-agency-uec/user/get/base-info HTTP/1.1" 200 None GET Request : url=http://dating-agency-api-test.qniao.cn/dating-agency-uec/user/get/base-info path_url=/dating-agency-uec/user/get/base-info headers={'User-Agent': 'python-requests/2.15.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'X-APP-ID': '50325897884795881', 'Authorization': 'QNT iHP4V/g6O5DXHixyNrf7tmEYvAdJBrPlSF4BRH+Igz89ZXDhdeBs41rIoxXMacBPZSaI+aYn7lK30ECpdcS5Ag==', 'X-Organization-Id': '963432943739605555'} body=None GET Response : url=http://dating-agency-api-test.qniao.cn/dating-agency-uec/user/get/base-info status=200, reason= headers={'Server': 'nginx/1.16.1', 'Date': 'Sun, 07 Apr 2024 06:32:48 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers'} body={"code":0,"message":"successful","data":{"userId":"974358220019732480","realName":null,"nickName":null,"phone":"18548157976","matchmakerFlag":false}} ${reps} = <Response [200]> ${phone} ${reps.json()['data']} phone Returns a value from the given ``dictionary`` based on the given ``key``. ${phone} = 18548157976 ${matchmakerFlag} ${reps.json()['data']} matchmakerFlag Returns a value from the given ``dictionary`` based on the given ``key``. ${matchmakerFlag} = False ${phone} Makes a variable available globally in all tests and suites. ${phone} = 18548157976 ${matchmakerFlag} Makes a variable available globally in all tests and suites. ${matchmakerFlag} = False ${file_path} ${EXECDIR}\\Phone.txt Returns the given values which can then be assigned to a variables. ${file_path} = D:\LYL\Study\Robot_framework\space\Dating-agency\Phone.txt ${file_path} ${phone},888888\n Appends the given content to the specified file. Appended to file '<a href="file://D:\LYL\Study\Robot_framework\space\Dating-agency\Phone.txt">D:\LYL\Study\Robot_framework\space\Dating-agency\Phone.txt</a>'. 接口:短信验证码登录认证 用户登录婚介平台 All Tests Dating-agency Dating-agency.0-Login Dating-agency.0-Login.Login-interface