Selenium WebDriver Tutorial #14 – What are the Basic Methods in WebDriver Interface

In this Selenium Webdriver Tutorial, we will learn about “What are the basic methods in WebDriver Interface. We will understand the basic methods along with examples and how to use those methods in Selenium Automation. Some of the basic WebDriver Interface methods are:

✅ get(java.lang.String URL): Load a new web page in the current browser window.

✅ manage(): Gets the Option interface.

✅ get current URL(): Get a string representing the current URL that the browser is looking at.

✅ getTitle(): The title of the current page.

✅ get page source(): Get the source of the last loaded page.

✅ navigate(): An abstraction allowing the driver to access the browser’s history and to navigate to a given URL.

✅ quit(): Quits this driver, closing every associated window.

✅ close(): Close the current window, quitting the browser if it’s the last window currently open.

✅ get window handle(): Return an opaque handle to this window that uniquely identifies it within this driver instance.

✅ getWindowHandles(): Return a set of window handles that can be used to iterate over all open windows of this WebDriver instance by passing them to switchTo().WebDriver.Options.window()

✅ switchTo(): Send future commands to a different frame or window.

✅ findElement(By by): Find the first WebElement using the given method.

✅ findElements(By by): Find all elements within the current page using the given mechanism.