I am trying to click on "Continue" Button of below mentioned URL but nothing is working for me. I have tried click() method, Action class and JavaScriptExecuter but nothing is working. Below is the my code.
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+ "\\src\\main\\resources\\All_Drivers\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://demo.midtrans.com/");
driver.manage().window().maximize();
driver.findElement(By.xpath("//a[@class='btn buy']")).click();
driver.findElement(By.xpath("//div[@class='cart-checkout']")).click();
WebElement frame = driver.findElement(By.id("snap-midtrans"));
driver.switchTo().frame(frame);
WebDriverWait wait = new WebDriverWait(driver,20);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='text-button-main']/span")));
//Continue Button
WebElement elem = driver.findElement(By.xpath("//div[@class='text-button-main']/span"));
Actions action = new Actions(driver);
action.moveToElement(elem, 561, 526).click().build().perform();
driver.quit();
Any suggestion would be appreciated.