ind*_*kar 0 python robotframework
实际上我想要一个随机的数字和我使用的Integer值的浮点值
${Impressions_Int}= Evaluate random.randint(0,19999)
Log ${Impressions_Int}
Run Code Online (Sandbox Code Playgroud)
我不知道我们应该为随机浮点值使用什么
获得随机浮动的最简单方法是使用制服 random.uniform(a, b)
例:
*** Test Cases ***
Random Float
[Documentation] This is some basic info about the test
[Tags] Smoke
${random_float} = Evaluate random.uniform(1.1, 1.9) modules=random
Run Code Online (Sandbox Code Playgroud)
结果:
${random_float} = 1.407633348084447
Run Code Online (Sandbox Code Playgroud)