From the course: Selenium Essential Training
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
WebDriver tips and tricks - Selenium Tutorial
From the course: Selenium Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.