Course Content
Selenium Python First Script
Selenium Python First Script
0/2
HTML Form elements
HTML Form elements
0/1
Handle HTML Frames
Handle HTML Frames
0/2
Handling Dropdown Lists
Handling Dropdown Lists
0/2
Selenium Action class
Selenium Action class
0/1
Selenium Python for Beginners [ 2024 ]
About Lesson

WebDriver Methods

There are multiple methods available in WebDriver that you can use in the scripts to control and interact with the browser. Some of the methods and it’s description are as follows in table format:

 

WebDriver Method Method Description
get(URL) This method opens the specified URL in the browser during automation.
forward() This method simulates the browser forward button. This method navigates to the next web page.
back() This method simulates the browser’s back button and navigates to the previous web page in the browser’s history.
close() The close() method closes the current instance of the browser.
quit() The quit() method closes all the browser windows, including the current instance.
findElement(By) This method returns the first web element returned by the By locator. If no element is on the page, the NoSuchElementException exception is raised. If there are multiple matches, consider using the below method. This method will only return the first element.
findElements(By) The findElements() method returns all the web elements that match the locator criteria. If there is no element, it returns an empty list.
Join the conversation