Flaky Test Issue

Hello Team,

I have a Flaky Test Issue where an object is working most of the times but every once in a while it fails.

Basically, the Object is used with a Click to select from the Google Address Suggestion. I am interacting with that object using only one object property. It looks like this in Katalon

On the web it is :

What should I do to fix this ?

Thanks,

What is the error? Is it always the exact same error?

Every time this Flaky Issue occurs the error is same. The error says it is unable to click on the phone field. Below is the part of script where this error occurs. The script sometimes fails to click on the Suggestion shown by Google but that Step is marked passed. Because the Script is unable to click on the Suggestion shown by Google the Dropdown which shows the suggestion is still there and script is then unable to click on the Step Phone field.

WebUI.delay(GlobalVariable.MediumDelay)

WebUI.click(findTestObject(‘5_Customer_Information_Page/Selecting_Google_Autofill_Suggestion’), FailureHandling.STOP_ON_FAILURE)

WebUI.delay(GlobalVariable.LongDelay)

/* The Script will generate a random numnber and if the randmon number is even then it will add data to the optional field of Apartment and if it is odd then it will not fill that out. */
int decide2 = ((org.apache.commons.lang.RandomStringUtils.randomNumeric(1)) as int)

if ((decide2 % 2) != 0) {
println(‘The Random Number generated by Script is odd so the script will not fill the Apartment Number Field with data.’)
}

if ((decide2 % 2) == 0) {
println('The Random Number generated by Script is Even and is : ’ + decide2)

def suitenumber = org.apache.commons.lang.RandomStringUtils.randomNumeric(3)

WebUI.sendKeys(findTestObject('5_Customer_Information_Page/Field_Apartment_Suite'), suitenumber)

}

WebUI.click(findTestObject(‘5_Customer_Information_Page/Field_Phone’))