0% found this document useful (0 votes)
63 views2 pages

DAY2

The document discusses the WebDriver interface in Java. It defines that an interface defines methods but not implementations, and classes that implement the interface must define those methods. WebDriver is an interface that defines common actions for controlling the browser, like getting, loading pages, and quitting. Some implementing classes for WebDriver are FirefoxDriver, ChromeDriver, and RemoteWebDriver. The document provides steps for creating an object of an implementing class with a WebDriver reference and lists some basic methods of the WebDriver interface like get(), getCurrentUrl(), getTitle(), getPageSource(), quit(), and close().

Uploaded by

Bapon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views2 pages

DAY2

The document discusses the WebDriver interface in Java. It defines that an interface defines methods but not implementations, and classes that implement the interface must define those methods. WebDriver is an interface that defines common actions for controlling the browser, like getting, loading pages, and quitting. Some implementing classes for WebDriver are FirefoxDriver, ChromeDriver, and RemoteWebDriver. The document provides steps for creating an object of an implementing class with a WebDriver reference and lists some basic methods of the WebDriver interface like get(), getCurrentUrl(), getTitle(), getPageSource(), quit(), and close().

Uploaded by

Bapon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

DAY-2 Material

Interface:
A Java interface defines a set of methods but does not implement them. A class that
implements the interface agrees to implement all of the methods defined in the
interface.

Webdriver is the Interface

All Known Implementing Classes:


AndroidDriver, AndroidWebDriver, ChromeDriver, EventFiringWebDriver, Firef
oxDriver, HtmlUnitDriver, InternetExplorerDriver,IPhoneDriver, IPhoneSimulat
orDriver, RemoteWebDriver, SafariDriver

Steps for Creating class object with reference to interface


1. Choose the Browse on which you want to perform Automation and Select
the respective class to implement Webdriver
Ex: FirefoxDriver()
2. Create an object for the Class and assign name to it
Selenium=New FirefoxDriver();

3.Then make Class object reference to the Webdriver Interface which you
want to implement
Webdriver Selenium=New FirefoxDriver();

Basis methods of Webdriver:


Get();
Load a new web page in the current browser window.

getCurentURl();
Get a string representing the current URL that the browser is looking at.
getTitle()

The title of the current page

getPageSource()
Get the source of the last loaded page.

Quit();
Quits this driver, closing every associated window.

Close();
Close the current window, quitting the browser if it's the last window currently open.

You might also like