Hi guys, I am looking for help, my test case error with notif : ‘…element click intercepted:…’
first I followed the guide from here to find and click element in web table : https://docs.katalon.com/katalon-studio/docs/handle_web_tables.html
with that guide the element success clicked, but shown error status in Job Progress like shown my capture,
Log Viewer :
Test Case Code :
table: for (int i = 0; i < Rows.size(); i++) {
List Cols = Rows.get(i).findElements(By.tagName(‘td’))
for (int j = 0; j < Cols.size(); j++) {
if (Cols.get(j).getText().equalsIgnoreCase(ExpectedValue)) {
Cols.get(16).findElement(By.tagName(‘button’)).click()
break
}
}
}
I allready change with Cols.get(16).click()
but still the same
html :
I love the code you have, however, how about:
table: for (int i = 0; i < Rows.size(); i++) {
List<WebElement> Cols = Rows.get(i).findElements(By.tagName('td'))
for (int j = 0; j < Cols.size(); j++) {
if (Cols.get(j).getText().equalsIgnoreCase(ExpectedValue)) {
driver.findElement(By.xpath("//table/tbody/tr[${i}+1]/button")).click()
break table;
}
}
}
If you know the column that has your “expectedText”, then you can remove the inner loop and just substitute the known column number (starting from 0) in your if statement.
Hi @grylion54 thanks for your suggestions (remove the inner loop and subs the known number column)
Job Proggress result : PASSED, and the element success clicked.
Code
table: for (int i = 0; i < Rows.size(); i++) {
List Cols = Rows.get(i).findElements(By.tagName(‘td’))
if (Cols.get(11).getText().equalsIgnoreCase(ExpectedValue)) {
Cols.get(16).findElement(By.tagName(‘button’)).click()
break
}
}