Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created August 26, 2020 15:20
Show Gist options
  • Save seleniumgists/77b6a4bf2c963d4f3b07284efd695f47 to your computer and use it in GitHub Desktop.
Save seleniumgists/77b6a4bf2c963d4f3b07284efd695f47 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.time.Duration;
public class TestClarinChrome {
private static final String URL = "https://clarin.com/";
private static final String EMAIL = "[email protected]";
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "/Users/test/personal/selenium/chromedriver");
// Initialize browser
WebDriver driver = new ChromeDriver();
// Open facebook
driver.get(URL);
// Maximize browser
driver.manage().window().maximize();
Thread.sleep(15000);
//To wait for element visible
final WebDriverWait wait;
wait = new WebDriverWait(driver, Duration.ofSeconds(15), Duration.ofMillis(100));
Thread.sleep(15000);
final WebElement noGracias;
noGracias = wait.until(ExpectedConditions.presenceOfElementLocated(By.className("btns btnSi ")));
noGracias.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment