I already fix the error , but I need first to scroll manually so that the edit button will work properly.The problem is Scroll are not working in my codes . kindly check my codes.
take note: the scroll bar will display if I scroll up and down using mouse or by using arrow down and arrow up
Manual mode:
Script mode
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.chrome.ChromeDriver as ChromeDriver
import org.openqa.selenium.WebElement as WebElement
import org.openqa.selenium.By as By
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
WebUI.openBrowser(‘’)
WebUI.maximizeWindow()
WebUI.setText(findTestObject(‘Page_Core Login/input_face_txtUsername’), ‘’)
WebUI.setEncryptedText(findTestObject(‘Page_Core Login/input_lock_outline_txtPassword’), ‘==’)
WebUI.sendKeys(findTestObject(‘Page_Core Login/input_lock_outline_txtPassword’), Keys.chord(Keys.ENTER))
WebUI.enhancedClick(findTestObject(‘Object Repository/Page_Core/p_Core Menu’))
WebUI.click(findTestObject(‘Object Repository/Page_Core/p_Loans’))
WebUI.click(findTestObject(‘Object Repository/Page_Core/span_Loan Master’))
WebUI.click(findTestObject(‘Page_Core/input_CID_txtSearchCIDLoan’))
WebUI.setText(findTestObject(‘Page_Core/input_CID_txtSearchCIDLoan’), ‘9203950’)
WebUI.sendKeys(findTestObject(‘Page_Core/input_CID_txtSearchCIDLoan’), Keys.chord(Keys.ENTER))
WebUI.delay(5)
WebUI.switchToFrame(findTestObject(‘Page_Core/iframe_Upload_ifrm1’), 60)
WebUI.scrollToElement(findTestObject(‘Page_Core/div_Particulars_ps-scrollbar-y’), 6000)
WebDriver driver = DriverFactory.getWebDriver()
‘Expected value from Table’
String ExpectedValue = ‘For Release’
‘To locate table’
WebElement Table = driver.findElement(By.xpath(‘//table/tbody’))
‘To locate rows of table it will Capture all the rows available in the table’
List rows_table = Table.findElements(By.tagName(‘tr’))
‘To calculate no of rows In table’
int rows_count = rows_table.size()
‘Loop will execute for all the rows of the table’
Loop: for (int row = 0; row < rows_count; row++) {
‘To locate columns(cells) of that specific row’
List Columns_row = rows_table.get(row).findElements(By.tagName(‘td’))
'To calculate no of columns(cells) In that specific row'
int columns_count = Columns_row.size()
println((('Number of cells In Row ' + row) + ' are ') + columns_count)
'Loop will execute till the last cell of that specific row'
for (int column = 0; column < columns_count; column++) {
'It will retrieve text from each cell'
String celltext = Columns_row.get(column).getText()
println((((('Cell Value Of row number ' + row) + ' and column number ') + column) + ' Is ') + celltext)
'Checking if Cell text is matching with the expected value'
if (celltext == ExpectedValue) {
'Getting the Country Name if cell text i.e Company name matches with Expected value'
println((('Text present in row number ' + column) + ' is: ') + Columns_row.get(2).getText())
String accountnum = Columns_row.get(0).getText()
WebElement element = driver.findElement(By.xpath(('//*[@id="' + accountnum) + 'edit"]'))
element.click()
//Columns_row.get(10).click()
//Columns_row.get(10).findElement(By.tagName('button')).click()
/*WebElement button = driver.findElement(By.xpath('//button'))
List<WebElement> actioncall = button.findElements(By.className('edit'))
println (actioncall.)
*/
'After getting the Expected value from Table we will Terminate the loop'
break
}
}
}
elemements are the highlighted