January 2018
Beginner to intermediate
354 pages
7h 59m
English
Finally, in the test method, we can call the lookup method to convert the code to the correct message. This eliminates having the same message in test data in multiple places and files, and only requires a change in one place, the property file:
@Testpublic void tc001_gmailLoginCreds(String rowID, String description, JSONObject testData) throws Exception { String user, password, getMessage; GmailLoginPO gmail = new GmailLoginPO(); user = testData.get("username").toString(); password = testData.get("password").toString(); if ( testData.get("error") == null ) { gmail.login(user, password); gmail.signOut(); } else { getMessage = Utils.lookupMessage( Global_VARS.exceptionMsgs, testData.get("error").toString()); ...
Read now
Unlock full access