How to login to gmail and check number of email in inbox exist

using the gmail plugin. how to login and get email count and fail test if count did not match
CustomKeywords.‘com.testwithhari.katalon.plugins.Gmail.getEmailsCount’(’<Email ID>’, ‘<Password>’, ‘<Email folder lable name>’)

I can get the count but how do I fail the test if the count is not match.


You can save this getEmailsCount into a variable and then compare it with a number you are expecting.

e.g :

assert getEmailsCount.equals(expectedEmailsCount)

this worked thanks. please closed

@waiki If it worked please consider marking it as a solution.