How to Print Test Execution Steps in the Test Suite Report. Else statement steps are not getting printed in the test suite report

I have requirement to print the else statement steps in the Test Suite Report. Please suggest the way to do that

I have requirement to print the else statement steps in the Test Suite Report. Please suggest the way to do that

Hi there,

If else statements steps are already printed in Test Suite Report. Do you want to print something else?

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Hi Oliver

In else I have number of Nested if else, that is not getting printed. Only single else is printed.

Please suggest on this.

1.if(***){}
2.else
3.{
4.if(){}
5.else if{}
6.else{}
7.}

Only Step 2 Else statement returned as Passed, but other else data is not printed

Is there any specific keywords or the method to print directly in the reports??

Hi there,

Can I have a picture of your if…else script and the generated Test Suite report?
Here is my script:

#1
if (1 == 2) {
} else {
if (4 == 4) {
println(123)
} else if (4 == 5) {
println(1234)
} else {
println(4324)
}
}

#2
if (1 == 2) {
} else {
if (2 == 4) {
println(123)
} else if (4 == 5) {
println(1234)
} else {
println(4324)
}
}

Attached are my reports for different cases. Clearly some else data are shown on the report.

Sorry if my example is not the same with yours.

Regards

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Hi Oliver

Thanks for your quick response. Your screens are related to the Test Case log, I have issue related to the Test Suite Report.

Please look into the code posted below

‘Checking My Account Menu is Displayed on Dashboard or Not’
if (Mobile.verifyElementVisible(findTestObject(‘My Project/LandingPage/My Account Menu’), 3, FailureHandling.CONTINUE_ON_FAILURE) ==
false) {
System.out.println(‘My Account is not displayed in the Dashboard/Landing Page’)
} else {
‘Clicking on My Account Menu from Dashboard/Landing Page’
Mobile.tap(findTestObject(‘My Project/LandingPage/My Account Menu’), 10)

AppiumDriver driver = MobileDriverFactory.getDriver()

ArrayList ls = driver.findElementsByClassName(‘android.widget.TextView’)

println(ls.size())

for (int index = 0; index < ls.size(); index++) {
if (ls.get(index).getText().equals(‘Profile’)) {

‘Veryfing My Account - Profile’
‘Clicking on Profile from My Account Menu’
Mobile.tap(findTestObject(‘My Project/My Account/Profile/My Account - Profile Menu’), 5)

‘Checking Account Update Message Text is matching with the Expeced Text or Not’
if (messageText.equals(‘Your Profile has been updated successfully.’)) {
System.out.println(‘Account Update Message Text is matching with the Expeced Text’)
} else {
System.out.println('Account Update Message Text is not matching with the Expected Text, Expected Text is : Your Profile has been updated successfully. but Actual Text is ’ +
messageText)
}

‘Clicking on the Ok Button’
Mobile.tap(findTestObject(‘My Project/My Account/Profile/My Account - Profile - Ok Button’), 25)

‘Calling the Press Back Inbuilt funtion’
// Mobile.pressBack()
‘Delay’
Mobile.delay(10)

‘Calling the Press Back Inbuilt funtion’
Mobile.pressBack()

‘Delay’
Mobile.delay(10)
}//End of IF
else if (ls.get(index).getText().equals(‘Payment Information’)) {

‘Veryfing My Account - Payment Information’
‘Clicking on Payment Information from My Account Menu’
Mobile.tap(findTestObject(‘My Project/My Account/Payment Information/My Account - Payment Information Menu’), 5)

‘Entering the Card CVV Number’

‘Checking Payment Method Add Message Text is matching with the Expeced Text or Not’
if (messageText.equals(‘Your credit card details have been added successfully and will be validated once you choose to make a payment.’)) {
System.out.println(‘Payment Method Added Successfuly’)
} else {
System.out.println('Payment Method Add Message Text is not matching with the Expected Text, Expected Text is : Your credit card details have been added successfully and will be validated once you choose to make a payment. but Actual Text is ’ +
messageText)
}

‘Clicking on the Ok Button’
Mobile.tap(findTestObject(‘My Project/My Account/Payment Information/Add Payment Method Message Popup Ok Button’), 15)

‘Calling the Press Back Inbuilt funtion’
Mobile.pressBack()

‘Delay’
Mobile.delay(10)

‘Calling the Press Back Inbuilt funtion’
Mobile.pressBack()

‘Delay’
Mobile.delay(10)
}
else if (ls.get(index).getText().equals(‘Marketing Preferences’)) {

‘Veryfing My Account - Marketing Preferences’
‘Clicking on Marketing Preferences from My Account Menu’
Mobile.tap(findTestObject(‘My Project/My Account/Marketing Preferences/My Account - Marketing Preferences Menu’), 5)

‘Delay’
Mobile.delay(10)

‘Calling the Press Back Inbuilt funtion’
Mobile.pressBack()

‘Delay’
Mobile.delay(10)
}
else if (ls.get(index).getText().equals(‘About My Home’)) {

‘Veryfing My Account - About My Home’
‘Clicking on About My Home from My Account Menu’
Mobile.tap(findTestObject(‘My Project/My Account/About My Home/About My Home Menu’), 5)

‘Delay’
Mobile.delay(10)

‘Calling the Press Back Inbuilt funtion’
Mobile.pressBack()

‘Delay’
Mobile.delay(10)
}
}//End of FOR
}

Now Check only Else part is printed as passed. But else I have lots of statements

I also attached the Test Suite execution report in the above comment. Please suggest on this.

Hi Sahil,

If you talk about PDF report, then it is correct that it only show only parent log’s message, not any child messages behind it. This is an intended for PDF and also CSV report only as we just only show simple content for PDF report.

HTML report will show full logs otherwise.

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Hi Oliver

Thanks for ur useful inputs. Can we have that feature in coming future.

Hi there,

We will consider about it. However, we just want to add general solution by having some hook events for post execution so that users are freely to do what you want. If we have any other updates or new information, we will keep it updated.

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Thanks for your support. Closing this one.