Cross-Browser Selenium Java with automated WebDriver Download
Table of contents
Install necessary dependencies
Set up a Maven Project from console
Configure the pom.xml
Set up a Browser class with automated driver download
Create a data provider
Create a test case
Execute Cross-Browser-Tests from console
Download source code
Next step
Install necessary dependencies
To create and execute the project, you need a JDK and Maven. You can create the .java files with any editor, but it is recommended to install a proper editor like Visual Studio Code or Eclipse.
If you are using Windows, you should add the path to the bin folder of your Maven installation to the environment variables. To edit the environment variables execute the following steps:
- In Search, search for and then select: System (Control Panel)
- Click the advanced system settings link.
- Click Environment Variables
- Edit the System Variable Path
- Add the path to your Maven bin folder (e.g. C:\Maven\bin\)
To make sure, everything is installed correctly, execute the following commands in a console and compare the results:
java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Maven\bin\..
Java version: 1.8.0_231, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_231\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Set up a Maven Project from console
To set up a new Maven project, you should first create an empty folder that will contain all of your projects. Now open up a console and navigate to the created folder. In the console type the following command to create a new Maven Project named “twstest”:
mvn -B archetype:generate -DgroupId=com.tws.testframework -DartifactId=twstest -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4
After executing the maven command, a new folder twstest will be created containing the following structure:

To have a clean project, the files App.java and AppTest.java should be deleted. Both files contain a default structure for a Java program or for Java tests and are not necessary for this project.
Configure the pom.xml
Adding dependencies, like the Selenium.jar is very simple when you are using Maven. For plain Java, you have to search for the correct JAR-File and add it to your project. With Maven, you can just add new dependencies to the pom.xml file in the main folder of the project. When you start your project for the first time, Maven will automatically download all necessary dependencies and add them to your project. A list of available dependencies can be found in the maven repository at https://mvnrepository.com/.
For this project, the following dependencies need to be added, either in the version displayed in the source code of the pom.xml below or in as the latest version.
- Selenium Java
- TestNG
- Webdrivermanager
- Slf4j-api
- Slf4j-simple
After adding all dependencies, your pom.xml file should look like this:
<?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>com.tws.testframework</groupId>
<artifactId>twstest</artifactId>
<version>1.0-SNAPSHOT</version>
<name>twstest</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
To resolve all dependencies open up a console and navigate to the project folder. You should be inside the folder twstest and execute the following command that should end with a BUILD SUCCESS message:
mvn test
[INFO] Scanning for projects…
[INFO]
[INFO] -------------------< com.tws.testframework:twstest >--------------------
[INFO] Building twstest 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Set up a Browser class with automated driver download
After setting up the dependencies, a browser class can be implemented. This class will be called with a browser name and a value for the implicy wait. This way it can start a WebDriver for the given browser, maximize the windows and set the given implicy wait.
To implement the browser class, first create a new folder test/java/com/tws/testframework/framework. This folder will be used, to store every global class that will be used in the Selenium tests. Within the folder create a new java fill called Browser.java.
At first the imports should be created in the file. Besides the Selenium Package and the WebDriverManager all Imports for the Browsers you want to support should be considered. This Project will support Chrome, Firefox, Opera and Edge. Additionally, TimeUnit needs to be imported, to set the implicy wait. In the end the imports should look like this:
package com.tws.twsframework.framework;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.opera.OperaDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
import java.util.concurrent.TimeUnit;
public class Browser{
}
In the next step, the Browser method will be implemented. The method will receive the parameters browserName and implicyWait. Using IF-Statements, the correct Browser will be selected in written in the global variable driver. If the Browser name is not in the list of supported Browsers, an error message should be displayed and the driver variable will stay empty. This way, the tests using the wrong Browser will fail but tests using a correct Browser will still be executed. After getting the WebDriver with the help of the WebDriverManager, the implicy wait will be set and the windows will be maximized. After that, the source code should look like this:
package com.tws.twsframework.framework;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.opera.OperaDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
import java.util.concurrent.TimeUnit;
public class Browser{
public WebDriver driver;
public Browser(String browserName, int implicyWait){
if(browserName.toLowerCase().equals("chrome")){
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
}else if(browserName.toLowerCase().equals("firefox") || browserName.toLowerCase().equals("ff")){
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
}else if(browserName.toLowerCase().equals("edge") || browserName.toLowerCase().equals("eg")){
WebDriverManager.edgedriver().setup();
driver = new EdgeDriver();
}else if(browserName.toLowerCase().equals("opera") || browserName.toLowerCase().equals("op")){
WebDriverManager.operadriver().setup();
driver = new OperaDriver();
}else{
System.out.println("The browser " + browserName + " is not supported by this framework.");
}
driver.manage().timeouts().implicitlyWait(implicyWait, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
}
Create a test case
With the browser class ready, it’s time to create a first test case. Store all tests in a folder, if you have many tests, it might be useful to create subfolders within the test folder. For this project, only one test will be created. Therefore, it’s enough to create one folder for the tests at test/java/com/tws/testframework/test.
In this folder, create a file called FirstTest.java. At first, you need to implement all the imports. The first import is the browser class, we created in the framework folder. Additionally, the selenium By and WebDriver need to be imported. From testNG Assert and the annotations Test and AfterMethod will be needed. When all imports are done, the file should look like this:
package com.tws.twsframework.tests;
import com.tws.twsframework.framework.Browser;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.AfterMethod;
public class FirstTest{
}
To make sure, the Browser will be closed no matter if the test runs ok or fails, an AfterMethod will be implemented. This Method will be called after every test method and will close the browser. This way it’s not necessary to implement the close function within every test, and it will be handled on Exceptions as well. The AfterMethod will only call the WebDriver given in the Browser class. That’s why the browser variable should be implemented as a global variable in the test class. Including the AfterMethod the FirstTest.java should look like this:
package com.tws.twsframework.tests;
import com.tws.twsframework.framework.Browser;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.AfterMethod;
public class FirstTest{
public Browser browser;
@AfterMethod
private void closeBrowsers(){
browser.driver.quit();
}
}
Now that all preparations are done, the test method can be implemented. For this project, the test will open test-with-a-smile.de and check, if the logo is displayed. The test method will create a new browser, call the get function of the driver to open the website and in the end perform an Assert to verify the presence of the logo. The source code for this should look like this:
package com.tws.twsframework.tests;
import com.tws.twsframework.framework.Browser;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.AfterMethod;
public class FirstTest{
public Browser browser;
@Test
private void testCase() throws Exception{
browser = new Browser("chrome", 10);
browser.driver.get("https://test-with-a-smile.de");
Assert.assertEquals(true, browser.driver.findElement(By.xpath("//*[@id='headimg']/a/img")).isDisplayed());
}
@AfterMethod
private void closeBrowsers(){
browser.driver.quit();
}
}
With this implementation, the test will only be executed in Google Chrome. You can try it by calling mvn test from a console within the project. The call should look like this:
mvn test
[INFO] Scanning for projects…
[INFO]
[INFO] -------------------< com.tws.testframework:twstest >--------------------
[INFO] Building twstest 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ twstest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Projekte\Test With a Smile\Programme\twstest\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ twstest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ twstest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Projekte\Test With a Smile\Programme\twstest\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ twstest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to D:\Projekte\Test With a Smile\Programme\twstest\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ twstest ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.tws.twsframework.tests.FirstTest
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 88.0.4324.96 (resolved driver for Chrome 88)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\andip.cache\selenium\chromedriver\win32\88.0.4324.96\chromedriver.exe
Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784}) on port 32062
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Feb 07, 2021 8:54:47 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.046 s - in com.tws.twsframework.tests.FirstTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.733 s
[INFO] Finished at: 2021-02-07T20:54:49+01:00
[INFO] ------------------------------------------------------------------------
The first execution with a browser always might take a while, because the WebDriver for your installed browser will be downloaded from GitHub before the execution starts. In the end a result for one test without any failures or errors should be displayed.
To start the tests with multiple browsers it is possible, to add a parameter to the mvn test call. All browsers mentioned in this parameter should be executed. This will be implemented using the data provider in the next step.
Create a data provider
The data provider will read the value of the browser’s parameter of the maven call and hand it to every test. To do so, the test method needs to be adjusted and a new class BrowserProvide.java needs to be implemented in the folder test/java/com/tws/testframework/framework/. The DataProvider will generate a two-dimensional array from the parameter value by splitting it on every comma. By handing the data provider to a test, the test will be executed once for every parameter given, and it’s not necessary to write a test for every browser.
The data provider class should look like this:
package com.tws.twsframework.framework;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
public class BrowserProvider
{
@DataProvider (name = "browser-data-provider")
public Object[][] dpMethod(){
String givenBrowsers[] = System.getProperty("browsers").split(",");
Object browsers[][] = new Object[givenBrowsers.length][1];
for (int browserNo = 0; browserNo < givenBrowsers.length; browserNo++) {
browsers[browserNo][0] = givenBrowsers[browserNo];
}
return browsers;
}
}
To hand the data provider to a test method, the @Test annotation needs to be extended by the parameter dataProvider = “browser-data-provider”, dataProviderClass = BrowserProvider.class. Additionally, the parameter has to be set for the method itself as a string value. The class FirstTest.java should look like this, after the data provider is implemented:
package com.tws.twsframework.tests;
import com.tws.twsframework.framework.Browser;
import com.tws.twsframework.framework.BrowserProvider;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.AfterMethod;
public class FirstTest{
public Browser browser;
@Test(dataProvider = "browser-data-provider", dataProviderClass = BrowserProvider.class)
private void testCase(String browsername) throws Exception{
browser = new Browser(browsername, 10);
browser.driver.get("https://test-with-a-smile.de");
Assert.assertEquals(true, browser.driver.findElement(By.xpath("//*[@id='headimg']/a/img")).isDisplayed());
}
@AfterMethod
private void closeBrowsers(){
browser.driver.quit();
}
}
Execute Cross-Browser-Tests from console
Now that everything is set up the framework can execute the test for multiple browsers. The extended maven call has to contain the parameter browsers with all the browsers to execute. To execute the implemented test in Chrome, Opera, Edge and Firefox the call should look like this:
mvn test
[INFO] Scanning for projects…
[INFO]
[INFO] -------------------< com.tws.testframework:twstest >--------------------
[INFO] Building twstest 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ twstest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Projekte\Test With a Smile\Programme\twstest\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ twstest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ twstest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Projekte\Test With a Smile\Programme\twstest\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ twstest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to D:\Projekte\Test With a Smile\Programme\twstest\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ twstest ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.tws.twsframework.tests.FirstTest
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 88.0.4324.96 (resolved driver for Chrome 88)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\andip.cache\selenium\chromedriver\win32\88.0.4324.96\chromedriver.exe
Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784}) on port 32062
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Feb 07, 2021 8:54:47 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.046 s - in com.tws.twsframework.tests.FirstTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.733 s
[INFO] Finished at: 2021-02-07T20:54:49+01:00
[INFO] ------------------------------------------------------------------------
D:\Projekte\Test With a Smile\Programme\twstest>mvn test -Dbrowsers="chrome,opera,edge,firefox"
[INFO] Scanning for projects…
[INFO]
[INFO] -------------------< com.tws.testframework:twstest >--------------------
[INFO] Building twstest 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ twstest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Projekte\Test With a Smile\Programme\twstest\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ twstest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ twstest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Projekte\Test With a Smile\Programme\twstest\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ twstest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to D:\Projekte\Test With a Smile\Programme\twstest\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ twstest ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.tws.twsframework.tests.FirstTest
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 88.0.4324.96 (resolved driver for Chrome 88)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\andip.cache\selenium\chromedriver\win32\88.0.4324.96\chromedriver.exe
Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784}) on port 13468
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Feb 07, 2021 9:10:16 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using operadriver 87.0.4280.67 (resolved driver for Opera 73)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.opera.driver as C:\Users\andip.cache\selenium\operadriver\win64\87.0.4280.67\operadriver.exe
Starting OperaDriver 87.0.4280.67 (0e5d92df40086cf0050c00f87b11da1b14580930-refs/branch-heads/4280@{#1441}) on port 29268
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping OperaDriver safe.
OperaDriver was started successfully.
Feb 07, 2021 9:10:20 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: OSS
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using msedgedriver 88.0.705.63 (resolved driver for Edge 88)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Reading https://msedgedriver.azureedge.net/?restype=container&comp=list to seek msedgedriver
[main] INFO io.github.bonigarcia.wdm.online.Downloader - Downloading https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/88.0.705.63/edgedriver_win64.zip
[main] INFO io.github.bonigarcia.wdm.online.Downloader - Extracting driver from compressed file edgedriver_win64.zip
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.edge.driver as C:\Users\andip.cache\selenium\msedgedriver\win64\88.0.705.63\msedgedriver.exe
Starting MSEdgeDriver 88.0.705.63 (8c4f595b655cf82fd16941bc7908f00d82a87f4a) on port 34068
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
Feb 07, 2021 9:10:28 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using geckodriver 0.29.0 (resolved driver for Firefox 84)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.gecko.driver as C:\Users\andip.cache\selenium\geckodriver\win64\0.29.0\geckodriver.exe
1612728630301 geckodriver INFO Listening on 127.0.0.1:24430
1612728630738 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\Users\andip\AppData\Local\Temp\rust_mozprofileh5daAm"
Can't find symbol 'eglSwapBuffersWithDamageEXT'.
Can't find symbol 'eglSetDamageRegionKHR'.
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
1612728633667 Marionette INFO Listening on port 58385
1612728633921 Marionette WARN TLS certificate errors will be ignored for this session
Feb 07, 2021 9:10:33 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C
1612728635429 Marionette INFO Stopped listening on port 58385
!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 21.66 s - in com.tws.twsframework.tests.FirstTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.670 s
[INFO] Finished at: 2021-02-07T21:10:37+01:00
[INFO] ------------------------------------------------------------------------
Download source code
You can find the fully commented source code at GitHub:
https://github.com/TestautomationPopp/Selenium-Cross-Browser-With-Automated-Driver-Download
Next step
To improve this framework the next step is to implement page objects.