自动化框架 - 核心功能使用指南 - 动态值生成
  1. 功能说明

框架中支持多种动态值生成格式,这些格式可以用于在测试脚本中生成动态的数据。该功能不需要配置模块,只需要用 %方法名% 指定需要生成动态值的参数位置即可。
  1. 方法和格式

以下是每种格式的详细说明和示例:
  • %timestamp% : 当前时间戳
  • %datetime% : 当前日期时间
  • %date% : 当前日期
  • %time% : 当前时间
  • %random_int:min,max% : 随机整数
  • %random_float:min,max% : 随机浮点数
  • %random_string:length% : 随机字符串
  • %uuid% : UUID
  • %counter:name% : 计数器
  1. Excel 中使用

ParamsSetID ParamID Name Value DataGroup TestCaseID
var_body P1 params {
"operation": "set_variable",
"data": {
"cellNumber": "%random_int:min,max%",
"size": 20,
"time": "%datetime%"
},
"saveAsVariable": "body"
}
1 TC_OAH_Tenant_BuiltIn_Tasks_DN