|
String excelFile = "TestingData.xls";
String sheet = "Stop Payment";
DataReader dr;
Test Case Account From Cheque No To Cheque No Low Amount High Amount Payee Reason Expected Message
test_create_stoppayment (USD) 81400321 - Checking 1 9999 1 99999999 lance no comment Stop sent.
@Test
public void test_create_stoppayment() throws Exception {
dr = new DataReader(excelFile, sheet);
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap = dr.getTestingData("test_create_stoppayment");
//我将测试的数据储存在excel文件里,让后用datareader读书来
stopPayment.selectAccount(hashMap.get("Account"));
stopPayment.typeChequeFrom(hashMap.get("From Cheque No"));
stopPayment.typeChequeTo(hashMap.get("To Cheque No"));
stopPayment.clickCreate();
stopPayment.clickConfirm();
assertTrue(stopPayment.isTextPresent(hashMap.get("Expected Message")));
}
希望指教。
我觉得不好的地方是,每个测试的test case都需要重复的使用datareader读取每个test case的记录,有没有轻松一点的方法呀。
谢谢 |
|