hi,
i have a search text field and data table. once the keyword enters and hit ENTER from keyword the results will be displayed in the data table. so sending the data from excel sheet to enter into the textbox that is storing in a variable as ExpectedValue and wrote for loop that contains the related text from the display results. once it matches and trying to highlight the text . here is the code
WebUI.setText(findTestObject(‘searchtextfield’), findTestData(‘exceltestsuite’).getValue(1, 1))
WebUI.sendKeys(findTestObject(‘searchtextfield’), Keys.chord(Keys.ENTER))
String ExpectedValue = findTestData(‘exceltestsuite’).getValue(1, 1)
println(‘11111111------------>’ + ExpectedValue)
WebDriver driver = DriverFactory.getWebDriver()
WebUI.delay(5)
WebElement Table = driver.findElement(By.xpath(’//table[@id=‘datatable’]/tbody’))
List links = Table.findElements(By.xpath(’//tr/td’))
for (int j = 0; j < links.size(); j++) {
//println("total link: " + links.size())
‘Verifying the expected text in the each cell’
if (links.get(j).getText().contains(ExpectedValue)) {
println(links.get(j).getText())
println('------------>' + ExpectedValue)
String searchedword = links.get(j).getText();
println(">>>>>>>>>>>>>" + searchedword)
CustomKeywords.'packagename.classname.run'(searchedword)
break
} else {
CustomKeywords.'packagename.classname.run'(findTestObject('Reg6130(1)(a)/td_No Records found'))
}
}
please help me how to call the searchedword variable in the keyword.logs are below:
Reason:
org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: packagename.classname.run() is applicable for argument types: (java.lang.String) values: [I1900291]
Possible solutions: run(com.kms.katalon.core.testobject.TestObject), any(), dump(), grep(), find(), print(java.io.PrintWriter)