Selenium is the most widely used test automation tool across the globe for testing web based applications. Many of its attractive features make it more popular. It is easy to learn and use. There are several selenium webdriver methods that play important roles in making selenium an user-friendly test automation tool. This article discusses with all those selenium webdriver methods in detail.
Method : get ()
This will load a new web page in the window that is used presently. An HTTP get operation is used here and the method will be blocked until the loading is over.
This is used to get a string of current URL opened in the browser.
Method : getTitle()
Used to get the title of the current web page
This is used to find all the elements in the page that are used presently with the given mechanism
Syntax: findElements(By by)
This is used for finding the first web element using the suggested mechanism
Syntax: WebElement findElement (by by)
Used to get the page source of the page loaded currently
This is used for closing the current window. If multiple windows are open, it will close only the current window.
Syntax: void close()
This is for quitting the driver instance. Here all the windows opened will be closed.
Syntax: void quit()
This is used to return a set of window handles that can be used for iterating over all the open windows by passing them to.
Syntax: Set getWindowHandles()
This is used to switched to a window at a later date
Syntax: String getWindowHandle()
This is used for accessing the browser’s history and to navigate to a given URL.
Syntax: WebDriver.Navigation navigate()
This is used for getting option interface
These are the selenium webdriver methods and more about methods will be taught in selenium tutorials.