Hi guys i am having problem with get the datas in rows. i want the get the datas from under Name Surname column
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import org.openqa.selenium.By
import org.openqa.selenium.WebElement
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
WebUI.callTestCase(findTestCase('Login Page/Login'), [:], FailureHandling.STOP_ON_FAILURE)
WebUI.verifyElementPresent(findTestObject('Object Repository/Home Page/patientListTable'), 5)
WebUI.verifyElementPresent(findTestObject('Object Repository/Home Page/patientList_Row'), 5)
List<WebElement> rows = WebUI.findWebElements(findTestObject('Object Repository/Home Page/patientList_Row'),5)
assert rows.size() > 1
int numberOfRows = rows.size()
println "numberOfRows=${numberOfRows}"
for (WebElement row in rows) {
WebElement name = row.findElement(By.xpath("//div[@data-field='nameSurname']"))
assert name != null
println "name=${name.getText()}"
}
this is my code and this is the html code sorry for the censor. the xpath in devs console is for the rows and it is correct.
when i execute the code above it only prints NAME SURNAME in the console.
