*** Settings *** Library urllib3 Library Collections Library RequestsLibrary *** Test Cases *** uecLogin Disable Warnings Create Session ZTBT ${uecClient} ${client_login_header} ${data} Create Dictionary account=${account} captcha=${captcha} accountType=2 ${respones} POST On Session ZTBT uec/authorize/by-captcha json=${data} ${token} Get From Dictionary ${respones.json()['data']} token Set Global Variable ${token} login_token #转换业务线token Create Session login ${ztbClient} ${client_login_header} #${token} Set Variable iHP4V/g6O5DXHixyNrf7tpO/qkx7j1gsqvbpL1KZGKDiXY1mwnWhhmm5IF9A8sfQJSFGoxXp/OFiB/d1FyzKGg== # ${loginToken} Set Variable {"loginToken":"${token}"} ${reps} Post On Session login recycle-user-center/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')} ${TokenData} Get From Dictionary ${reps.json()} data #业务线token ${client_firstlogin_header} Set Variable {'Content-Type':'application/json','Authorization':'QNT ${TokenData}','X-APP-ID':'503258978847953926'} #移动端首次登录header Set Global Variable ${TokenData} Set Global Variable ${client_firstlogin_header} user_info #获取用户信息 Create Session login ${ztbClient} ${client_firstlogin_header} ${reps} GET On Session login recycle-user-center/user/get/user-info ${userId} Get From Dictionary ${reps.json()['data']} userId #获取用户id ${mobile} Get From Dictionary ${reps.json()['data']} mobile #获取用户手机号 ${realName} Get From Dictionary ${reps.json()['data']} realName #获取用户真实姓名 ${enterpriseInfos} Get From Dictionary ${reps.json()['data']} enterpriseInfos #获取用户所在企业信息 FOR ${items} IN @{enterpriseInfos} ${factoryInfos} Get From Dictionary ${items} factoryInfos #企业工厂信息 ${enterpriseId} Get From Dictionary ${items} enterpriseId #企业id ${organizationId} Get From Dictionary ${items} organizationId #企业组织id ${enterpriseName} Get From Dictionary ${items} enterpriseName #企业name Exit For Loop If '${enterpriseId}'=='738812239011778560' END FOR ${factoryInfo} IN @{factoryInfos} ${factoryId} Get From Dictionary ${factoryInfo} factoryId #工厂id ${factoryName} Get From Dictionary ${factoryInfo} factoryName #工厂name Exit For Loop If '${factoryId}'=='738816441691803648' END ${client_header} Set Variable {'Content-Type':'application/json','Authorization':'QNT ${TokenData}','X-APP-ID':'503258978847953926','X-FACTORY-ID':'${factoryId}'} ${Header} Set Variable {'Authorization':'QNT ${TokenData}','X-APP-ID':'503258978847953926','X-FACTORY-ID':'${factoryId}'} Set Global Variable ${factoryId} Set Global Variable ${factoryName} Set Global Variable ${client_header} Set Global Variable ${organizationId} Set Global Variable ${enterpriseName} Set Global Variable ${Header}