Not sure whether to write this as a general issue I’m facing (and maybe there’s some actionable step I can take to address it), or a bug with the Log Viewer…
… but it is a frustration.
I have this test case, where steps seem to get nested within each other in the logs. Here is snippet of it:
//Navigate to home page for consistent starting point
WebUI.navigateToUrl(SMDConstants.DASHBOARD_PAGE_URL)
goToPracticeCreationPage()
CreatePracticePage page = new CreatePracticePage(WebUI.getUrl());
fillInPracticeDetails(model, page);
fillInContractAddressDetails(model);
NPINumberHandler.GetInstance().handle(page.getNpiNumber(), {
GeneralWebUIUtils.HandleSaveButton(findTestObject('Page_Zoho shared repository/Practice subpages/Top row/Save button'))
GeneralWebUIUtils.WaitForURLNotEquals(page.getUrl(), 5)
WebUI.verifyElementText(findTestObject('Object Repository/Page_Practice - Zoho CRM/First Row Section/Status'),
SMDConstants.ACTIVE)
}, { StepFailedException ex ->
if (!WebUI.verifyElementPresent(findTestObject('Object Repository/Page_Create Practice - Zoho CRM/Practice Details Section/NPI Number error message'),
5,
FailureHandling.OPTIONAL)) {
throw new StepFailedException("Found an error on the page, for field: '${page.getLabelForFirstUserErrorField()}'");
}
return true;
}, {
return page.generateAndEnterNPINumber();
})
Test case fails, intentionally. I cause an error by commenting out a line of code in fillInContractAddressDetails()
. It is defined to be:
void fillInContractAddressDetails(PracticeModel model) {
WebUI.scrollToElement(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/Contact Address Details section'), 0)
//Set Address
WebUI.setText(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/Address 1 input field'),
model.getContactInfo().getAddress())
// WebUI.setText(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/City input field'),
// model.getContactInfo().getCity())
WebUI.setText(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/State Autocomplete/State autocomplete input field'),
model.getContactInfo().getState())
WebUI.waitForElementClickable(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/State Autocomplete/First State dropdown option'),
3)
WebUI.click(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/State Autocomplete/First State dropdown option'))
WebUI.setText(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/Zip Code input field'),
model.getContactInfo().getZip())
}
The log message is fine for the test case entry itself. I see the error message that I wrote in it. However, when I go look down the rabbit hole, I see that I’ve been forced to put up with this:
The last line of the last in-test-case method that was called, fillInContractAddressDetails()
is like this:
WebUI.setText(findTestObject('Page_Create Practice - Zoho CRM/Contact Address Details Section/Zip Code input field'),
model.getContactInfo().getZip())
and for some reason, anything that happens thereafter is getting nested into that last statement in the Log Viewer.
I should move these methods to the page
, but I don’t see the logs for that, also that is another question altogether.
What is causing this?