Selenium sample (Java)

This is a sample of Selenium.

ex01.java


import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
 
public class ex01 {
 
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.get("https://ekzemplaro.org/storytelling/");
	try {
		System.out.println("Stop for 5 seconds");
		Thread.sleep(5000);
		System.out.println("The pause has been released.");
	} catch(InterruptedException e){
		e.printStackTrace();
		}
        driver.quit();
    }
}

Makefile


ex01.class: ex01.java
	javac ex01.java -cp ./client-combined-3.14.0.jar 
clean:
	rm -f ex01.class

compile

$ make
javac ex01.java -cp ./client-combined-3.14.0.jar

Execution method

export CLASSPATH=.:./client-combined-3.14.0.jar:./guava-26.0-jre.jar:./okhttp-3.11.0.jar:./okio-2.0.0.jar:./kotlin-stdlib-1.2.60.jar:./commons-exec-1.3.jar
#
java ex01

You will need the following jars at run time:

client-combined-3.14.0.jar guava-26.0-jre.jar okhttp-3.11.0.jar okio-2.0.0.jar kotlin-stdlib-1.2.60.jar commons-exec-1.3.jar

This is the Java environment I used.

$ javac --version
javac 10.0.2
$ java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13)
OpenJDK 64-Bit Server VM (build 10.0.2+13, mixed mode)

Recommended Posts

Selenium sample (Java)
Selenium Sample Reservation Form (Java)
[Java] Generics sample
Java sample code 02
Java sample code 03
Java GUI sample
Java sample code 04
Selenium x Java
Java sample code 01
[Java] Holiday judgment sample
[Java] logback slf4j sample
Digital signature sample code (JAVA)
Java parallelization code sample collection
Java
Java standard log output sample
Java
Selenium
[For beginners] Run Selenium in Java
Java 9 new features and sample code
Use Chrome Headless from Selenium / Java
A simple sample callback in Java
Follow the link with Selenium (Java)
BloomFilter description and implementation sample (JAVA)
[Java] Date period duplication check sample
EXCEL file update sample with JAVA
Sample vending machine made in Java
Sample code using Minio from Java
Java learning (0)
Studying Java ―― 3
[Java] array
Java protected
[Java] Annotation
Java array
Studying Java ―― 9
Java scratch scratch
java (constructor)
[Java] ArrayDeque
java (override)
java (method)
Java Day 2018
Java string
java (array)
Java static
java beginner 4
Studying Java ―― 4
Java (set)
java shellsort
[Java] compareTo
Studying Java -5
java reflexes
Java memorandum
☾ Java / Collection
Java array
Studying Java ―― 1
[Java] Array
[Java] Polymorphism
Studying Java # 0
Java review
java framework
Java features
[Java] Inheritance