循環按鍵
# index爲當前循環的次數,size爲循環的總次數
[Arguments] ${button} ${size}
:FOR ${index} IN RANGE 0 ${size}
\ click element ${button}
\ sleep 2
操作 "${按鈕名稱}" 按鈕
run keyword if 'xxx'=='xxx' click element //div[@id="test"]//button[text()="${按鈕名稱}"]
... ELSE IF '${按鈕名稱}'=='abc' click element //div[@id="test2"]//button[text()="${按鈕名稱}"]
# 調用時可以直接寫:操作"test"按鈕
關於關鍵字參數:
點擊名稱爲${operator:(|"|“| |)}"${按鈕名稱}" 按鈕
xxxx
# 調用:點擊名稱爲“阿道夫”的按鈕;
# ${operator:(|"|“| |)} 中爲正則表達式,也可以指定參數的值:${operator:(移動端|PC端)}