Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Discover the Top Tips and Tricks of the Selenium WebDriver

DZone 's Guide to

Discover the Top Tips and Tricks of the Selenium WebDriver

A tutorial on how to make the most of the Selenium WebDriver.

· Performance Zone ·
Free Resource

Selenium WebDriver is one of the most popular frameworks for web automation. To get more from your Selenium WebDriver tests there are many test frameworks, services, and libraries, which can help you to organize your tests, monitor their execution, and provide comprehensive reports. This article describes solutions for three aspects of automation testing. Creation of parameterized tests, test execution reports, and logging for Selenium WebDriver.

Parameterized tests are necessary for cases when you need to execute the same suite of tests with different test data. You can write several identical tests, but with different input conditions, but it’s not an optimal solution. What you need is to add parameters for your tests. Thus, one test will be performed several times under different conditions.

Test execution reports help you to present test execution results in a friendly format. The TestNG framework offers a list of tests and statuses corresponding to them. Such statistics give a general idea of the success of the tests. Nevertheless, you may get intermediate results for each stage of test execution into the reports. To do this, you need to add the Allure framework. It will show not only the statistics of test execution but also step-by-step actions in each test.

Logging in the Selenium WebDriver is a necessary thing for complex multi-step tests for tracking the logic of test case execution. For example, you can connect logging methods, implemented in Log4j library.

All the examples for this article are written in Java, use TestNG framework, Idea IDE and for some test examples, the Maven builder is used.

TestNG parameterized tests

How to Launch a Few Tests With Similar Parameters

If some parameter is defined for all tests of a project.

Often in web automation, it happens that the same values have to be used in different tests. In this case, one can use the TestNG capacity to define a certain parameter for a test suite in the configuration file. For example, to provide the URL for the Selenium WebDriver method for the execution of a test suite. The example of such a test written in the TestNG framework is shown below.

public class TestNGParameterExample {
@Parameters({“firstSampleParameter”})
@Test(enabled = true)
public void firstTestForOneParameter(String firstSampleParameter) {
driver.get(firstSampleParameter);
WebElement searchBar = driver.findElement(By.linkText(“Mobile Device & Browser Lab”));
searchBar.click();
Assert.assertEquals(driver.findElement(By.tagName(“h1”)).getText(), “Mobile Device & Browser Lab”);

}
@Parameters({“firstSampleParameter”})
@Test
public void secondTestForOneParameter(String firstSampleParameter) {
driver.get(firstSampleParameter);
WebElement searchBar = driver.findElement(By.linkText(“Live Cross Browser Testing”));
searchBar.click();
Assert.assertEquals(driver.findElement(By.tagName(“h1”)).getText(), “Cross Browser Testing”);
}
}
testng.xml file structure is shown below.
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1" >
<parameter name="firstSampleParameter" value="https://experitest.com/"/>
<test name="Nopackage" >
<classes>
<class name="TestNGParameterExample" />
</classes>
</test>
</suite>

Parameterized tests have to be launched with a builder, for instance, Maven. Now we are going to demonstrate how to feed parameters to the Selenium WebDriver tests with the TestNG test framework.

Selenium WebDriver Tests with Parameters

Passing Simple Values to a Test.

If you need to create tests, which enable you to process data sets, you can use DataProvider. DataProvider is a method, which returns a two-dimensional array of objects. The first dimension of this array is the number of test launches. The second dimension of this array has to correspond to the number and types of the test parameters.

The method has annotation @DataProvider The example of code on simple test suites is shown below:

@DataProvider()
public Object[][] listOfLinks() {
return new Object[][] {
{“Mobile Device & Browser Lab”, “Mobile Device & Browser Lab”},
{“Live Cross Browser Testing”, “Cross Browser Testing”},
{“Automated Mobile Testing”, “Mobile Test Automation!”},
};
}

The "test" refers to the data provider method with the corresponding name.

@Test(dataProvider = “listOfLinks”)
public void firstTestWithSimpleData(String linkname, String header) {
driver.get(“https://experitest.com/”);
WebElement searchBar = driver.findElement(By.linkText(linkname));
searchBar.click();
Assert.assertEquals(driver.findElement(By.tagName(“h1”)).getText(), header);
}

Let’s execute the command mvn clean test and check the execution results.

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 34.23 s – in TestSuite

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ————————————————————————

[INFO] BUILD SUCCESS

Passing Iterative Objects

The example with passing iterative objects is shown in the code below. In this example, parameters are passed to the test method in the ArrayList.

@DataProvider(name = “iterator”)
public Iterator<Object[]> locales() {
List<Object[]> data = new ArrayList<Object[]>();
data.add(new String[]{“Mobile Device & Browser Lab”});
data.add(new String[]{“Live Cross Browser Testing”});
data.add(new String[]{“Automated Mobile Testing”});
return data.iterator();
}
@Test(dataProvider = “iterator”)
public void secondTestWithIterator(String locale) {
driver.get(“https://experitest.com/”);
WebElement searchBar = driver.findElement(By.linkText(linkname));
searchBar.click();
}

Data from a CSV File.

The data required for the test execution can be written to a CSV file. In this case, the same iterative object can be used to pass data to the test. In the DataProvider method, data from the CSV file has to be copied to the ArrayList and then used in the method @Test. Data from the CSV file is read-string by string and split by the delimiter char. For the code example let’s use the same data, as they are in the example below, but place them into the data.csv file. The changed code of the test will look in the following way:

@DataProvider(name=”valid”)
public Iterator<Object[]> valid() throws IOException {
List<Object[]> data = new ArrayList<Object[]>();
BufferedReader reader = new BufferedReader(new FileReader(new File(“src/test/resources/data.csv”)));
String line = reader.readLine();
while (line != null) {
String[] split = line.split(“;”);
data.add(split);
line = reader.readLine();
}
return data.iterator();
}
@Test(dataProvider = “valid”)
public void third(String[] str) {
driver.get(“https://experitest.com/”);
WebElement searchBar = driver.findElement(By.linkText(str[0]));
searchBar.click();
Assert.assertEquals(driver.findElement(By.tagName(“h1”)).getText(), str[1]);
}

data.csv structure is shown below:

Mobile Device & Browser Lab; Mobile Device & Browser Lab

Live Cross Browser Testing; Cross Browser Testing

Automated Mobile Testing; Mobile Test Automation

Data from a JSON file

Another format for the test data representation is the JSON format. The approach of feeding test data to test is to use iterative objects. The only difference from the approaches shown above is that the DataProvider method has to process a JSON file and fill an ArrayList with data from it. For this task, we need to create a class in which JSON array elements will be passed. In the Selenium WebDriver test, we get values as these class instances. For the convenience of working with JSON objects, the library gson is used. The documentation for this library can be found here. Use this dependency section to add it to the maven project.

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>test</scope>
</dependency>

For the code example let’s use the same data, as they are in the example below, but place them into the data.JSON file. The changed code of the test will look in the following way:

@DataProvider()
public Iterator<Object[]> validFromJSON() throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(new File(“src/test/resources/data.JSON”)));
String JSON = “”;
String line = reader.readLine();
while (line != null) {
JSON += line;
line = reader.readLine();
}
Gson gson = new Gson();
List<TestData> data = gson.fromJSON(JSON, new TypeToken<List<TestData>>(){}.getType());
return data.stream().map((o) -> new Object[] {o}).collect(Collectors.toList()).iterator();
}
@Test(dataProvider = “validFromJSON”)
public void testForJSONData(TestData element) {
driver.get(“https://experitest.com/”);
WebElement searchBar = driver.findElement(By.linkText(element.getLink()));
searchBar.click();
Assert.assertEquals(driver.findElement(By.tagName(“h1”)).getText(), element.getHeader());
}
data.JSON file structure is shown below:
[
{“link”: “Mobile Device & Browser Lab”, “header”: “Mobile Device & Browser Lab”},
{“link”: “Live Cross Browser Testing”, “header”: “Cross Browser Testing”},
{“link”: “Automated Mobile Testing”, “header”: “Mobile Test Automation”}
]
TestData class is presented below. @Expose annotation indicates that this element has to be available for JSON serialization and deserialization.
import com.google.gson.annotations.Expose;
public class TestData {
@Expose
String link;
@Expose
String header;
public String getLink() {
return link;
}
public String getHeader() {
return header;
}
}

Test Report with Allure

After you have a considerable number of Selenium WebDriver tests you need to find an instrument to control their execution results. As a rule, you are interested in information about successful tests, and the number of tests whose execution finished with a failure. This basic information can be provided by the TestNG framework. It can be connected to your project from the Maven repository. Comprehensive documentation for the framework can be found at this link. After the tests are executed, an XML document with the execution results is formed and an HTML document for their presentation is created.

For example, we have three tests. Two of them are passed and one fails. After tests are executed the execution result will be printed out to the IDE console.

[INFO] Results:

[INFO]

[ERROR] Failures:

[ERROR] TestNGReport.testLink(TestNGReport)

[INFO] Run 1: PASS

[INFO] Run 2: PASS

[ERROR] Run 3: TestNGReport.testLink:39 expected [Mobile Test Automation!] but found [Mobile Test Automation]

[INFO]

[INFO]

[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

[INFO]

[INFO] ————————————————————————

[INFO] BUILD FAILURE

TestNG also created a report and it can be found in /target/surefire-reports/index.html folder.

TestNG shows the list of tests that failed and their number, string in the test code where the error occurred and the error description. However, if we want to trace the test execution step by step and get the statistics on test groups, statistics of test execution, download the test execution results in CSV format, it’s recommended to connect your tests to the Allure framework and use it.

Allure — is a framework for displaying the test execution results and for generating test execution reports. If we use the maven builder, the Allure library has to be defined in the dependency section of the maven pom.xml file.

In the build section of the pom.xml file, we need to provide a path to the testng.xml file, which has the description of tests to be launched. In the file allure.properties we need to define a path to the folder with allure report as one of the parameters.

allure.results.directory=target/allure-results

The resulting pom.xml file with dependency and build sections is shown below.

<dependencies>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>2.12.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<argLine>
-javaagent:”${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar”
</argLine>
<suiteXmlFiles>
<suiteXmlfile>src/test/resources/testng.xml</suiteXmlfile>
</suiteXmlFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.9</version>
<configuration>
<propertiesFilePath>src/test/resources/allure.properties</propertiesFilePath>
<reportDirectory>allure-results</reportDirectory>
<reportVersion>2.6.0</reportVersion>
</configuration>
</plugin>
</plugins>
</build>

To demonstrate the displaying of a test execution steps, let’s create the test, using the data provider in which each step is described with the method @Step. Each test step description should be added in parameters. The code of the test is shown below.

@DataProvider()
public Object[][] listOfLinks() {
return new Object[][] {
{“Mobile Device & Browser Lab”, “Mobile Device & Browser Lab”},
{“Live Cross Browser Testing”, “Cross Browser Testing”},
{“Automated Mobile Testing”, “Mobile Test Automation!”},
};
}
@Test(dataProvider = “listOfLinks”)
public void testLink(String linkname, String header) {
goToLink();
clickLinkText(linkname);
Assert.assertEquals(driver.findElement(By.tagName(“h1”)).getText(), header);
}
@Step(“Go to URI https://experitest.com”)
public void goToLink() {
driver.get(“https://experitest.com/”);
}
@Step(“Click link on the page”)
public void clickLinkText(String linkname) {
WebElement searchBar = driver.findElement(By.linkText(linkname));
searchBar.click();
}

Use mvn clean test command typed in the console to launch the test.

Test execution results will appear in the folder target/allure-results. To generate a report and open the Allure page, execute the command, typed in the console:  allure serve target/allure-results.

The main page of the Allure report shows the statistics of test executions, distribution tests over test suites and categories.

You may navigate to the section with the list of tests. The statistics of the executed tests, each test execution time, list of parameters for each test, and test groupings are shown there as well.

Going to a specific test you may see a lot of information related to the test: A list of steps, the execution time of each step, status, category, list of parameters, error messages for a failed test and other information.

In this part, we discussed the basic set of Allure framework properties. Besides getting reports on the local environment, you may integrate it with Jenkins and use it for continuous integration.

Generating Log Files in Selenium WebDriver Tests

Let’s imagine that we have a complex set of Selenium WebDriver tests, and it’s necessary to track the status of both the tests themselves and the individual steps while the Webdriver is running. Perhaps we will need not only to display messages in the console but also to keep a full-fledged journal about what is happening in our test. To achieve these goals, we will use log4j. Below is an example of using the log4j library.

Create a set of primitive tests. To do this, create a class LogTest:

import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class LogTest {
WebDriver driver = new ChromeDriver();
WebDriverWait wait = new WebDriverWait(driver, 60);

@BeforeTest
public void beforeTest() {
System.setProperty(“WebDriver.chrome.driver”,”F:\\Jenkins\\workspace\\chromedriver.exe”); // <-- Change this path[/html_tags_show]</span><br /> <span class="font-size-10"> System.out.println(“Test started”);
}

@Test
public void Experitest1(){
String expectedText = “Last updated: 22 May 2018”;
String actualText = “”;
driver.get(“https://experitest.com/legal”);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//div[2]/div/div/p[3]/span”)));
actualText = driver.findElement(By.xpath(“//div[2]/div/div/p[3]/span”)).getText();
if (actualText.contentEquals(expectedText)){
System.out.println(“1st TEST PASSED!”);
} else {
System.out.println(“1st TEST FAILED”);
}
}

@Test
public void Experitest2(){
String expectedTitle = “experitest.com”;
String actualTitle = “”;
driver.get(“https://experitest.com/free-trial/”);
actualTitle = driver.getTitle();
if (actualTitle.contentEquals(expectedTitle)){
System.out.println(“2nd TEST PASSED!”);
} else {
System.out.println(“2nd TEST FAILED”);
}
}

@Test
public void Experitest3() {
String expectedTitle = “experitest.com”;
String actualTitle = “”;
driver.get(“https://experitest.com/pricing”);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//*[@id=\”starter\”]”))).click();
actualTitle = driver.getTitle();actualTitle.contentEquals(expectedTitle);
if (actualTitle.contentEquals(expectedTitle)){
System.out.println(“3rd TEST PASSED!”);
} else {
System.out.println(“3rd TEST FAILED”);
}
}

@Test
public void Experitest4(){
wait.until(ExpectedConditions.elementToBeClickable(By.xpath(“/html/body/div[1]/div/div/div/div[3]/a”))).click();
Boolean isPresent = driver.findElements(By.xpath(“/html/body/section/div/div[3]/div/div[2]/div”)).size() > 0;
if (isPresent){
System.out.println(“4th TEST PASSED!”);
} else {
System.out.println(“4th TEST FAILED”);
}
}

@AfterTest
public void afterTest(){
driver.quit();
System.out.println(“Test complete!”);
}
}

And also create TestNG config file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Default Suite">
<test name="comtestdemo_node1">
<classes>
<class name="mbabilo.LogTest">
<methods>
<include name="Experitest1"/>
<include name="Experitest2"/>
<include name="Experitest3"/>
<include name="Experitest4"/>
</methods>
</class> <!-- mbabilo.LogTest -->
</classes>
</test> <!-- comtestdemo -->
</suite> <!-- Default Suite -->

Launch these tests and you will see the following information in the IDE console:

As you can see, we used the standard display method –  System.out.println(“”) ; however, it is only suitable for printing out some information or sometimes for debugging tests and is not so convenient to use for keeping detailed logs. To implement real logging, use log4j library.

Apache Log4j library is a Java-based logging utility which allows you to write data to a file line by line. In addition, log4j has 7 logging levels that you can use for your needs, namely: ALL, DEBUG, INFO, WARN, ERROR, FATAL, TRACE, and also no-logging level – OFF.

Add log4j to your project:

Add an import directive of necessary log4j library to the code:

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

Import the latest version of the library:

b) Add a reference to the library config file:

create a Logger instance, working with the LogTest.class before @BeforetTest annotation:

 Logger log = Logger.getLogger(LogTest.class); 

using the Configurator, specify the path to the future config file. To do this, add the following to the beginning of @BeforetTest annotation:

 PropertyConfigurator.configure(“F:\\Experitest\\comtestlog4jDemo\\log4j.properties”); As you can see, the file is called log4j.properties and it is located in the folder of your project. It can be located in any directory, but the project folder is the most convenient one for this file.

c) Create the project config file:

The first that should be specified is the log level and a place where the log data will be printed out. You may specify the output direction for a specified log level.

# Root logger option
log4j.rootLogger=ALL, file, stdout

In the string above parameters: ALL – is a log level, file – which means that the logs will be printed out to a file, stdout – means that logs will be printed out to the IDE console.

Then, set parameters for output:

# Direct log messages to a log file
# specification of a library to write logs to a file
log4j.appender.file=org.apache.log4j.RollingFileAppender
# specification of the path and the name of .log file. Please note that for the demonstration only the name of the final file is indicated. In this case, the file will be saved in the root folder of the project.
log4j.appender.file.File=logging.log
## setting max size for one .log file = 10MB
log4j.appender.file.MaxFileSize=10MB
# set number of log files = 10. This means that when the size of the first .log file reaches 10 megabytes, a new file will be created for writing, and so on up to 10 files.
log4j.appender.file.MaxBackupIndex=10
# It means that the PatternLayout class will be used to use patterns
log4j.appender.file.layout=org.apache.log4j.PatternLayout
# This is the creation of a pattern for logging. First parameter is date and time in the specified format, second is a log level, third is a class name, then mapping level of the nested class, line number of code for which message will be logged and output message
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L – %m%n

Following this pattern, add logging to the console:

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L – %m

You can find more info about configuration parameters here.

Update the code of tests, replacing the System.out.println() calls with calling log4j methods. Since it has already created an instance of the Logger log, you can use the following construction:

 log.info(“it’s ok”); or log.debug(“it’s ok”); or log.error(“it’s not ok”); etc.

The code of the example test with connected logging is shown below.

import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class LogTest {

WebDriver driver = new ChromeDriver();
Logger log = Logger.getLogger(LogTest.class);
WebDriverWait wait = new WebDriverWait(driver, 60);

@BeforeTest
public void beforeTest() {
PropertyConfigurator.configure(“F:\\Experitest\\comtestlog4jDemo\\log4j.properties”);
System.setProperty(“WebDriver.chrome.driver”, “F:\\Jenkins\\workspace\\chromedriver.exe”); // <-- Change this path[/html_tags_show]</span><br /> <span class="font-size-10"> log.info(“Test started”);
}

@Test
public void Experitest1() {
String expectedText = “Last updated: 22 May 2018”;
String actualText = “”;
driver.get(“https://experitest.com/legal”);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//div[2]/div/div/p[3]/span”)));
actualText = driver.findElement(By.xpath(“//div[2]/div/div/p[3]/span”)).getText();
log.debug(“get date of updating doc”);
if (actualText.contentEquals(expectedText)) {
log.info(“1st TEST PASSED!”);
} else {
log.info(“1st TEST FAILED”);
}
}

@Test
public void Experitest2() {
String expectedTitle = “experitest.com”;
String actualTitle = “”;
driver.get(“https://experitest.com/free-trial/”);
actualTitle = driver.getTitle();
log.debug(“get title of page”);
if (actualTitle.contentEquals(expectedTitle)) {
log.info(“2nd TEST PASSED!”);
} else {
log.info(“2nd TEST FAILED”);
}
}

@Test
public void Experitest3() {
String expectedTitle = “experitest.com”;
String actualTitle = “”;
driver.get(“https://experitest.com/pricing”);
log.debug(“page is loaded”);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//*[@id=\”starter\”]”))).click();
log.debug(“\”Choose Plan\” button is exist and clickable”);
actualTitle = driver.getTitle();
if (actualTitle.contentEquals(expectedTitle)) {
log.info(“3rd TEST PASSED!”);
} else {
log.info(“3rd TEST FAILED”);
log.debug(“it’s Ok, the title for this page isn’t experitest.com”);
}
}

@Test
public void Experitest4() {

wait.until(ExpectedConditions.elementToBeClickable(By.xpath(“/html/body/div[1]/div/div/div/div[3]/a”))).click();
log.debug(“click at Contact Us”);
Boolean isPresent = driver.findElements(By.xpath(“/html/body/section/div/div[3]/div/div[2]/div”)).size() > 0;
if (isPresent) {
log.info(“4th TEST PASSED!”);
} else {
log.info(“4th TEST FAILED”);
}
}

@AfterTest
public void afterTest() {

driver.quit();
log.info(“Test complete!”);
}
}


Launch the test and check the execution result in the IDE console:

and in the .log file:

Now you know how to connect and configure log4j logging for your Selenium tests. You can use different levels and amounts of logging for various purposes, as well as output all logs or only critically important for you.

Now, let’s add special logging Exceptions, for the demonstration we will edit only one test – Experitest3:

@Test
public void Experitest3() {
String expectedTitle = “experitest.com”;
String actualTitle = “”;
driver.get(“https://experitest.com/pricing”);
log.debug(“page is loaded”);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//*[@id=\”starter\”]”))).click();
log.debug(“\”Choose Plan\” button is exist and clickable”);
actualTitle = driver.getTitle();
try {
int A = 5/0;
} catch(Exception e) {
log.log(Level.ERROR,”Exceptions happen!”, e); //this will put all the details in log file configured earlier
org.testng.Assert.fail();
}
if (actualTitle.contentEquals(expectedTitle)) {
log.info(“3rd TEST PASSED!”);
} else {
log.info(“3rd TEST FAILED”);
log.debug(“it’s Ok, the title for this page isn’t experitest.com”);
}
}

Run the test, and see what we get in the end in the IDE console and in the log.

Did this work for you? Did I make a mistake? Comment below and let me know!

Topics:
performance ,selenium ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}