This file contains 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 java.util.concurrent.TimeUnit; // Selenium 3 | |
import java.time.Duration; // Selenium 4 | |
// selenium 3 usage | |
FluentWait wait = new FluentWait(driver) | |
.pollingEvery(20, TimeUnit.MILLISECONDS) | |
.withTimeout(20, TimeUnit.SECONDS) | |
.ignoring(NoSuchElementException.class); | |
//selenium 4 usage |
This file contains 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.chrome.ChromeDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
public class ChromeDriverExample { | |
final static String PROJECT_PATH = System.getProperty("user.dir"); | |
public static void main(String[] args) throws IOException { |
This file contains 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.edge.EdgeDriver; | |
import org.openqa.selenium.edge.EdgeOptions; | |
public class EdgeDriverExample { | |
final static String PROJECT_PATH = System.getProperty("user.dir"); | |
public static void main(String[] args) throws IOException { | |
System.setProperty("webdriver.edge.driver", PROJECT_PATH+ "/src/main/resources/EdgeDriver.exe"); |
This file contains 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.safari.SafariDriver; | |
import org.openqa.selenium.safari.SafariOptions; | |
public class SafariDriverExample { | |
public static void main(String[] args) throws IOException { | |
SafariOptions safariOptions = new SafariOptions(); | |
safariOptions.setAcceptInsecureCerts(true); |
This file contains 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.ie.InternetExplorerDriver; | |
import org.openqa.selenium.ie.InternetExplorerOptions; | |
public class InternetExplorerDriverExample { | |
final static String PROJECT_PATH = System.getProperty("user.dir"); | |
public static void main(String[] args) throws IOException { | |
System.setProperty("webdriver.ie.driver", PROJECT_PATH+ "/src/main/resources/IEDriverServer.exe"); |
This file contains 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.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import java.util.List; | |
public class FindsByExample { | |
final static String PROJECT_PATH = System.getProperty("user.dir"); | |
public static void main(String[] args) { |
This file contains 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.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.interactions.Actions; | |
public class DeprecatedExamples { | |
final static String PROJECT_PATH = System.getProperty("user.dir"); |
This file contains 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
package Tests; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.Keys; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
class GoogleSearchTest{ | |
final static String PROJECT_PATH = System.getProperty("user.dir"); |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>selenium4</groupId> | |
<artifactId>selenium4</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<build> |
This file contains 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
plugins { | |
id 'java' | |
} | |
group 'SeleniumGradleSample' | |
version '1.0-SNAPSHOT' | |
sourceCompatibility = 1.8 | |
repositories { |
OlderNewer