From the course: Selenium Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

WebDriver tips and tricks

WebDriver tips and tricks - Selenium Tutorial

From the course: Selenium Essential Training

Start my 1-month free trial

WebDriver tips and tricks

- [Instructor] In this video I'll explain more about how WebDriver works through the use of a simple test written in Java. The test is shown here in the IDE IntelliJ. At the top of this test class on lines one through four, I start by importing the various packages to use Selenium functionality. I'll explain how the packages are used in just a minute. For now let's focus on the details of the test class. In line 10 I set the location for the ChromeDriver specifying where the ChromeDriver is downloaded on my local computer. In the body of the test class there is a short test that sets up a new WebDriver instance of ChromeDriver on line 13. On line 16 it navigates to Google. On line 19 it finds an element with the name of q. On line 22 it sends keys to it. And then on line 25 it submits to that field. Then on line 28 it quits the driver. Now I'll walk through each line of this test in detail. First, a new instance of the…

Contents