This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String URL = "https://www.linkedin.com/home"; | |
private static final String EMAIL = "[email protected]"; | |
private static final String TEXT = "Hola Selenium 4 (alpha 6) - automated, hola LINKEDin"; | |
private static final String PWD = "blah blah"; // pasword changed for obvious reasons | |
public static void main(String[] args) throws InterruptedException { | |
System.setProperty("webdriver.chrome.driver", "/Users/test/personal/selenium/chromedriver"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/> | |
<link href="/assets/favicon.ico" rel="icon" type="image/x-icon" /> | |
<script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script> | |
<script src="/assets/displayhelpservlet.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
var json = Object.freeze('{"consoleLink": "\u002fgrid\u002fconsole","type": "Grid Hub","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}'); | |
</script> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By.cssSelector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By.XPath("//input[@value='GET TIPS']") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final WebElement submitEmail = wait.until(ExpectedConditions.presenceOfElementLocated(By.tagName("submit"))); | |
submitEmail.click(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="submit" value="GET TIPS" data-wait="Please wait..." class="button-2 bg-blue w-button"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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.cssSelector(("img[src='<https://images.clarin.com/collections/static/logo_clarin.svg>']")))); | |
noGracias.click(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Builder, Capabilities } = require('selenium-webdriver'); | |
//var firefox = require('selenium-webdriver/firefox'); | |
const chrome = require('selenium-webdriver/chrome'); | |
const chromeOptions = new chrome.Options(); | |
chromeOptions.addArguments(["--ignore-certificate-errors", | |
"--allow-running-insecure-content", | |
"--disable-extensions", | |
"--start-maximized"]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(15), Duration.ofMillis(100)); | |
WebElement usernameField = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[data-test-id='SignIn-Username']"))); |