|
我不是编程高手,所以希望有相似经验的人可以过来看看帮助解答一下
比如我要写一个提交创建用户的方法,我需要把每个field的值单独传进去了,还是测试数据作为一个object传进去了?
下面是个例子
这个我觉得参数太多,不太好用- public UserDetailsPage createUser(String type, String userId, String password, String customerNumber, String mobileNumber,
- String firstName, String lastName, String branch, String role) {
-
-
-
- select("name=userType", "label="+type);
- type("userid", userId);
- type("password", password);
- type("mobilearthId", "mobilearthId");
- type("customerNumber", customerNumber);
- type("networkId", "networkId");
- type("isoCountryCode","isoCountryCode");
- type("mobileNumber", mobileNumber);
- type("networkId2", "networkId");
- type("isoCountryCode2","isoCountryCode");
- type("mobileNumber2", mobileNumber);
- type("email", "email");
- type("email2", "email2");
- type("firstName", firstName);
- type("lastName", lastName);
- select("branchId", "label="+branch);
- select("role", "label=" + role);
-
- clickAndWaitForPageToLoad("submit");
- return new UserDetailsPage(selenium);
-
- }
复制代码 有没有比较好的方法了,能够贴个例子看下吗,谢谢了 |
|