Hello,
I have several questions about a script.
1- In the String Data = new String [numDatos] section there are times that the part of numDatos is removed from the script execution. Do you know why?
String ExpectedValue = Jobcode
String Texto_Max_Pags = WebUI.getText(findTestObject('Object Repository/Assign/max_pags'))
int Max_Pags = Integer.parseInt(Texto_Max_Pags)
WebDriver driver = DriverFactory.getWebDriver()
WebElement Table = driver.findElement(By.xpath('//table/tbody'))
List<WebElement> Rows = Table.findElements(By.tagName('tr'))
for (int p = 1; p <= Max_Pags; p++) {
println('El número de filas es: ' + Rows.size)
for (int i = 1; i < Rows.size(); i++) {
List<WebElement> Cols = Rows.get(i).findElements(By.tagName('td'))
int numDatos = Cols.size - 3
String[] Datos = new String[numDatos]
if (Cols.get(10).getText().equalsIgnoreCase(ExpectedValue)) {
println('El número de columnas es: ' + Cols.size)
for (int j = 2; j < (Cols.size() - 1); j++) {
(Datos[(j - 2)]) = Cols.get(j).getText()
println(((('Datos ' + (j - 2)) + '-') + ' ') + (Datos[(j - 2)]))
}
System.out.println(Datos)
System.out.println(('Resultado: \'' + (Datos[8])) + '\'')
GlobalVariable.DatosTabla = Datos
}
if (i == (Rows.size - 1)) {
WebUI.click(findTestObject('Object Repository/Assign/flecha_dch'))
}
}
i = 1
driver = DriverFactory.getWebDriver()
Table = driver.findElement(By.xpath('//table/tbody'))
Rows = Table.findElements(By.tagName('tr'))
}
2- When I do an execution, if’s that do not enter take a long time to finish. Is that because of a configuration problem?