1).可复用性
-关键字(函数)最小化,再根据业务需求进行小关键字的组合(扩大)
-这样做,使得多个Pattern(相似场景)模式下,可复用性更高
2).函数改善(自定义RF)
-should be equal(改善加入,actual>>log actual, expected>> log expected.
3).framework
-locator
-keyword
-customLib(python extension)
-file
-testcase
4)Locator和关键字的名字,要有意义,便于区分,也便于被调用。
5)多人开发自动化。确认UI界面个数,工程师分别开发不同的UI界面(Locator和keyword),避免多人同时开发时修改同一个文件(Locator和keyword)带来的冲突。
6)每个keyword中加个Wait Element(),这样可减少单独开发wait关键字,提高开发效率
ex:
click_close_Pgxxx
Wait Until Element Is Visible ${Pgxxxx_btn_閉じる_locator}
click Element ${xxxx_btn_閉じる_locator}
input_数量_Pgxxxx
[Arguments] ${text}
Wait Until Element Is Visible ${Pgxxxx_input_数量_locator}
input text ${xxxx_input_数量_locator} ${text}