To markFailedAndStop or Not To markFailedAndStop?

Based on the criteria of the original tests I set up several months ago, if an object was missing, that was a critical error and needed to be flagged. Since we were making heavy adjustments to the code base, anything missing needed to be checked. Things have changed quite a bit, so if an object is missing, should the situation be handled within an IF statement  or does a missing object represent a much larger problem and the test has to be flagged as an Error? This continues on from the idea of checking for the existence of an object without throwing an error. Using a Custom Keyword is was possible to suppress the error and not fill the log with False Positives. Taking that a step further, it seems we could check if an object exists and continue on with the test if needed or exit out of the test completely. Using the example from before, let’s say we […]

Checking for the presence of an object without throwing an error

One of my goals has to been to make my tests less noisy and not generate errors in the log unless it’s really necessary. For example, if an object is missing from the page, that may or may not be an error. If a tab is missing, the user may not meet the criteria to make it display. When checking for the existence of an object using the WebUI.verifyElementVisible() keyword, a lot of additional logging that can be misleading. For example, this code block will execute as expected, but generates 2 entries for the Failed log. @Keyword //Function to determine if an item exists on the page boolean verifyObjectVisible(String objectReference) { try { WebUI.verifyElementPresent(findTestObject(objectReference),5) return true; } catch (Exception e) { log.logWarning(“The object with the name, ” + objectReference + ” was not found. Exiting Test.”) return false; } } There is a cleaner way to check for an object using the WebUiCommonHelper.findWebElement command, which is part of the, import […]

More Katalon Studio and Automation to come

Although I haven’t posted anything for some time now, I haven’t abandoned automation or Katalon Studio. Quite the opposite. I’ve completed several Udemy courses for Groovy, Java, automation and SQL. Along with that, I’ve used this slower time of the year to review all my code and make improvements so that my tests are more resilient, more modular, more scalable and less “noisy.” There have also been quite a few changes to Katalon Studio. There is the ability to import and export Custom Keywords, so moving more code to that section of the project seems ideal. The Execution Profiles are a bit easier to work with, so I’ve moved more data out of the tests themselves and set them up as Global Variables. Cucumber BDD is available as well, and while I’m not using it currently, I did take a Udemy course on it so it might be something I try to incorporate into my project in the future. Of […]