public void UserConsentCreate(String TestNumber,String email,String lastName,String firstName,String deviceCode, String appVersion,String phone,String countryCode,String loginPassword,String dob,String baseUrl, String contactViaEmail, String contactViaSMS,String address1, String address2, String city, String postcode, String ukResidentConfirmation, String notificationConsent, String locationConsent
,String hasMedicalCondition, String hasAwaitingDiagnosis) throws IOException {
int version = MaintreeVersion(TestNumber);
System.out.println(version);
JSONObject body =new JSONObject();
body.put("personReference",dataReader.PERSONREFERENCE_PROPERTY_READER(TestNumber));
body.put("contactViaEmail",contactViaEmail);
body.put("contactViaSMS",contactViaSMS);
body.put("mainTreeVersion",version);
JSONObject auidtbody =new JSONObject();
auidtbody.put("localTime", dtf.format(now));
auidtbody.put("GMTTime", dtf.format(now));
auidtbody.put("appRequestedTime", dtf.format(now));
auidtbody.put("agentId", "1");
auidtbody.put("agentName", "App");
auidtbody.put("channel", "APP");
auidtbody.put("deviceCode","1234567890");
body.put("audit",auidtbody);
}
CSV ファイルを使用してデータ データ プロバイダー コードを取得しました
@DataProvider(name = "customer" )
public static Object[][] getUserData() throws IOException, CsvValidationException {
**String xlFilePath = System.getProperty("user.dir") + "/src/TestData/User.csv";
String[] line;
List<String[]> arrlist = new ArrayList<String[]>();
CSVReader reader = new CSVReader(new FileReader(xlFilePath));
while ((line = reader.readNext()) != null) {
arrlist.add(line);
}
int index = 0;
arrlist.remove(index);
int rowCount = arrlist.size();
int columnCount = arrlist.get(0).length;
String customerData[][] = new String [rowCount][columnCount];
for(int i = 0 ; i < rowCount ; i++) {
String[] eachRow = arrlist.get(i);
for(int j = 0 ; j < columnCount ; j++) {
customerData[i][j] = eachRow[j];
}
}
return customerData;
}
テスト メソッドのパラメーターを宣言する他の方法はありますか? 1つのパラメータ変更すべてのメソッドを変更したい.この問題を解決する方法. 私はそれが機能している方法でString args []を試みます。知りたいのですが、他に解決策はありますか?