- 數學運算 注意:python2中的整除使用/;在python3中使用//;取餘沒有差別
- 保留2位小數
${b} set variable 3.1415926
${a} evaluate round(${b},2)
should be true ${a} 3.14
-
直接使用python内置方法
擷取本機使用者名:
擷取本機名稱 n a m e 和 I P : {name}和IP: name和IP:{IP} 擷取本機使用者名 上面保留2位小數的,也屬于python内置方法 - 轉換大小寫
${a} Set Variable TEST
${low} Evaluate '${a}'.lower()
should be equal ${low} test
${upper} Evaluate '${low}'.upper()
should be equal ${upper} TEST