*** Settings *** Library RequestsLibrary Library Collections *** Variables *** ${num} [1,2,3] ${list} [1,2,3,4,5] *** Test Cases *** 生成随机数 #取列表中的随机数 #${value} Evaluate random.choice(${num}) random #log to console \nvalue: ${value} @{list} Set Variable A B C D FOR ${var} IN @{list} Run Keyword If '${var}'==B Exit For Loop log ${var} #Set Global Variable ${var} 图片base64加密 ${filepath} Set Variable E:/lyl/图片/20210805134405.jpg ${pic_base64} Evaluate base64.b64encode(open('${filepath}','rb').read()).decode('utf-8') base64 log ${pic_base64} *** Keywords *** list [Arguments] ${list} ${value} Evaluate random.choice(${num}) random log to console \nvalue: ${value}