I have a routine that collects data from a browser table and works great if there is only enough data to fill one browser page. But now I’m getting more data that spans multiple browser pages. On the bottom I have the “Next>” button but can’t get it to work. the code below works great for one page but is there are more I can’t get it to work:
import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
WebDriver driver = DriverFactory.getWebDriver()
‘Expected value from Table’
‘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()
The above code gives me the number of rows on the first page/table of data but I have over 100 pages to work through.
Any ideas?