Skip to content

Instantly share code, notes, and snippets.

@Jaimin180296
Created May 26, 2021 19:02
Show Gist options
  • Save Jaimin180296/ce902803fe7cc61cacaa6713b6ac6861 to your computer and use it in GitHub Desktop.
Save Jaimin180296/ce902803fe7cc61cacaa6713b6ac6861 to your computer and use it in GitHub Desktop.
driver.get("https://www-am-uat1-global-vuse.non-prod.marketing.bat.net/co/es/customer/account/create/");
WebDriverWait wait;
wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[text()='Aceptar todas las cookies']"))).click();
Select objSelect = new Select(driver.findElement(By.id("age-gate-dob-day")));
objSelect.selectByIndex(4);
Select objSelect1 = new Select(driver.findElement(By.id("age-gate-dob-month")));
objSelect1.selectByIndex(4);
Select object2 = new Select(driver.findElement(By.id("age-gate-dob-year")));
object2.selectByIndex(20);
driver.findElement(By.xpath("//button[@class='action allow secondary']")).click();
Thread.sleep(5000);
WebElement click = driver.findElement(By.xpath("//button[@type='submit' and @class='action submit primary']"));
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].scrollIntoView(true);", click);
executor.executeScript("arguments[0].click();", click);
Thread.sleep(5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment