Hello,
Versions
- Katalon 5.4
- Chrome 67
**Problem : **I’m trying to execute Katalon script. The goal is to check if fields contains a specific value. I use a loop to browse all the table.
However, I don’t understand the error…
Moreover error not occure everytime at the same time. Sometime it occure during first loop iteration, sometimes on the third, …
Error
Test Cases/test FAILED because (of) org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
…
*** Element info: {Using=xpath, value=.//td[4]/a}
Code
List<WebElement> elements = driver.findElements(By.xpath('//*[@id="id1"]//tr[td/a]'))
for (element in elements) {
...
if (!excelValue.equals(CustomKeywords.'datadriven.DataDriven.getValueFromExcel'('Sheet1', 'ColumName', 1))) {
element.findElement(By.xpath('.//td[4]/a')).click()
def webvalue = WebUI.getAttribute(findTestObject(object1), 'value')
WebUI.verifyEqual(webvalue.contains(excelValue), true)
WebUI.click(findTestObject(object2))
}
}
Already tried
- java - stale element reference: element is not attached to the page document - Stack Overflow
- QA & Testing: StaleElementException
Thank’s for help!
Regards