Stale element reference (evaluating Katalon)

Day two of my Katalon evaluation and I can’t get past what should be a simple task - selecting an option from a listbox on a web page (in Chrome). When you select this listbox option it updates the page and this is what I think is causing Katalon to fail.

Interestingly, it does select the desired listbox option, but then throws the error “org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document”.

The line of code it fails on is:
WebUI.selectOptionByValue(findTestObject(‘pageWelcome/listboxGoto3’), ‘SYSTEM_USER_NOTES#LIST’, true)

@gengland Since you are evaluating KS, I will put in my suggestion of the boolean you have on the statement. You have true, and that means you want to use Regular Expression. In other words, you do not want to use exact comparison against the string value, SYSTEM_USER_NOTES#LIST. So the string value is not the exact text in your value attribute. Personally, I suggest you change it to false since it likely is the exact text.

As for your StaleElementReferenceException, you can change the whole phrase to:
WebUI.selectOptionByLabel(findTestObject('pageWelcome/listboxGoto3'), 'Notes', false)
and see if that helps.

Confirm choice

After you selected the option, you can confirm the choice worked.
WebUI.verifyOptionSelectedByLabel(findTestObject('pageWelcome/listboxGoto3'), 'Notes', false, 10)

2 Likes

Thanks so much, this worked. I didn’t notice the selectOptionByLabel option!

1 Like