How to make a loop to scan an array and bring its data one by one and fill in the input?
The image illustrates well the problem ... I need For For to pass several times through the method and get the data from it and fill in the input and follow the normal flow of automation.
I get the input from the method data:
driver.findElement(By.xpath("/html/body/center/table/tbody/tr[2]/td[2]/form/table[3]/tbody/tr[17]/td/input[1]")).sendKeys(offers());
I click on filtering the data for it popular TextArea
:
driver.findElement(By.xpath("/html/body/center/table/tbody/tr[2]/td[2]/form/table[3]/tbody/tr[17]/td/input[2]")).click();
I select the populated data in textArea
:
Select selecionapermanenciamulta = new Select(driver.findElement(By.xpath("/html/body/center/table/tbody/tr[2]/td[2]/form/table[3]/tbody/tr[19]/td/table/tbody/tr/td[1]/select")));
selecionapermanenciamulta.selectByIndex(0);
Click the arrow to take it to the other side:
driver.findElement(By.xpath("/html/body/center/table/tbody/tr[2]/td[2]/form/table[3]/tbody/tr[19]/td/table/tbody/tr/td[2]/input[1]")).click();
Vector with data:
public static String offers (){
List<String> offrers = new ArrayList<String>();
offrers.add ( "dados");
offrers.add ( "dados");
offrers.add ( "dados" );
Collections.shuffle ( offrers );
return offrers.get(0);
}