There is a functionality like in sometimes one of modal pops up and there is a button on it. If the modal pops up user needs to click on that button. This is a continuous process and I need to automate it. How to handle this situation using selenium with java? My code is as below,
public void Orders() throws InterruptedException {
OrdersPage op = new OrdersPage(driver);
WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//span[contains(text(),’Reject’)]”)));
//op.clickAccept();
op.clickReject();
How to can I run this one continuously? (may be once a day or until stopped manually)?
Source: Read More