通过selenium pagefactory模式查找元素时所有的元素名称要和页面元素保持一致,如果名称特别长,在名称之间以下划线隔开
在对点击事件的方法命名时,都要以click开头,例如clickLogin()
在对需要填入的事件的方法命名时,都要以fill开头,例如fillUsername()
在对选择时间的方法命名时,都要以select开头,例如 selectName()
配置参数步骤
在feature文件中添加参数,参数名称为所测试功能缩写或全写
创建json文件,文件名和功能文件的参数名称保持一致 例如 AuthConfigParams
生成对应的类名,类名和功能文件的参数名称保持一致例如 AuthConfigParams
在jsonDataReader添加读取数据的方法
属性的命名方法
参数的路径json文件的名称+path,例如 authConfigPath
List 集合的命名方法 json文件名称+list,例如authorConfigParamList
在jsonDataReader中获取参数路径的方法命名如下图
在jsonDataReader中获取参数值的方法命名如下图