I have a web application in which I press the submit button until the data on the table is available. When there is no data available in my data, then send the hidden button. That way, we can get the logic until we send the hidden buttons. we show a success message and load the following browser URL.
for (k=0;k>30;k++) {
try {
driver.findElement(By.xpath(".//*[@id='content']/input")).click();
driver.switchTo().alert();
driver.switchTo().alert().accept();
Thread.sleep(20000);
} catch (org.openqa.selenium.NoSuchElementException e){
System.out.println(""+location+" Done");
}
}
Here, driver.findElement(By.xpath(".//*[@id='content']/input")).click();
this line presses the submit button. And after sending one warning, the browser shows why I accept this. In this cycle, for (k=0;k>30;k++)
Blindly, I take 30 .. Is there any logic or any misconception how I can control this ...

source
share