Selenium Webdriver Appium Complete TutorialSelenium Webdriver Appium Complete Tutorial
Automation Testing
  • Tools
    • Selenium
      • Selenium Java Tutorial
      • Selenium C# Tutorial
    • Appium
      • Appium Java Tutorial
      • Appium C#Tutorial
    • Katalon
  • Trainings
  • TestNG
  • Reports
    • Extent Reports
      • Extent Reports – Java
      • Extent Reports – Java -Version3
      • Extent Reports – C#
    • Vigo Reports
    • AT Excel Report
  • Excel
    • Apache POI – Java
    • Excel With C#
  • Interview Questions
    • Selenium Interview Questions
    • Java Interview Questions
    • C# Interview Questions
  • Demo Site
  • Practice Site
  • More…
    • AutoIt
    • Sikuli
    • Robot Class
    • File Upload
    • ScreenShot
      • AShot
      • ShutterBug
  • About
December 10, 2016

Selenium Webdriver Methods





Selenium Webdriver Methods will discuss about the API provided by the Selenium Webdriver. We have so many webdriver methods to automate the web application. Selenium provided huge number of methods to interact with the browser to automate the applications. Each method will have its own purpose to use.

Below are the few important methods which we will use very frequently:

MethodDescription
close()It will close the current browser where the driver focus is.
findElement()It will identify the single web element on the web page.
findElements()It will identify the list of web elements which is having same locator.
get()It will be used to navigate to the particular website. It accepts the url as an argument.
getCurrentUrl()It will give the url of the currently focused web page in the form of string.
getPageSource()It will return the entire page source(i.e. Html code) of the currently focused web page in the form of string.
getTitle()It will return the title of the currently focused web page in the form of string.
getWindowHandle()It will be used the get the current window information. By using this we can switch between the windows. Return type of this method is WebDriver.
getWindowHandles()It will hold all the windows information which are opened by the web driver. By using these information we can switch between the opened windows.
navigate()It will be used to navigate to the previous and next web pages.
quit()It will be used to close all the web pages which are opened by the webdriver.
switchTo()This will be very helpful to switch between the windows, frames and alters in the application.
clear()This method is used to clear the content of the textbox.
sendKeys()This method is used to enter the data into the textbox.
click()This method is used to click on the buttons or links on the web page.
getAttribute() This method will be used to get the attribute values of a particular locator.
submit()This method will be used to submit the form on a webpage.
selectByVisibleText() This method will be used to select a value from the drop down using the text of the options in the drop down.
selectByIndex()This method will be used to select a value from the drop down using the index value.
selectByValue()This method will be used to select a value from the drop down using the value attribute.

These are the methods which we will use very frequently while automating the application using selenium webdriver. Will discuss all these things in the coming blogs.

Please watch the YouTube video for this blog for better understanding.



Share this post: on Twitter on Facebook

CSS Selector in Selenium WebDriver Launch Browser in Selenium3

Related Posts

TAKING WEB ELEMENT SCREENSHOT IN SELENIUM

Selenium - Java

How to Capture WebElement Screenshot in Selenium Webdriver using selenium 4

avoid Switch to window

Selenium - Java

How to Avoid Switch To Window in Selenium WebDriver

webdrivermanager

Selenium - Java

No More Driver EXE files for Selenium Execution – Instead Use WebDriverManager

HANDLE TEXTBOXES IN SELENIUM

Selenium - Java

Handling Textboxes in Selenium

JAVASCRIPTEXECUTOR IN SELENIUM

Selenium - Java

JavaScriptExecutor in Selenium

ELEMENT NOT VISIBLE EXCEPTION

Selenium - C#, Selenium - Java

Selenium ElementNotVisibleException

NOSUCHWINDOW EXCEPTIONS

Selenium - C#, Selenium - Java

Selenium NoSuchWindowException

NOSUCHFRAME EXCEPTIONS

Selenium - C#, Selenium - Java

Selenium NoSuchFrameException

NOSUCHELEMENT EXCEPTION

Selenium - C#, Selenium - Java

Selenium NoSuchElementException

SELENIUM WEBDRIVER EXCEPTIONS

Selenium - C#, Selenium - Java

Selenium WebDriver Exceptions

Newsletter

Recent Posts

  • TAKING WEB ELEMENT SCREENSHOT IN SELENIUMHow to Capture WebElement Screenshot in Selenium Webdriver using selenium 4
    December 15, 2019
  • How To SWAP Two Numbers in Java Without using Temp VariableHow to SWAP Two Numbers in Java Without Temp variable or Without Third variable
    December 8, 2019
  • How to Swap Two Numbers in Java with Temp VariableHow to SWAP Two Numbers in Java using Temp Variable
    December 1, 2019
  • How to Read Properties file in JavaHow to Read Data From Properties File in Java
    November 27, 2019
  • Compare two arrays in java with out inbuilt functionsHow to Compare Two Arrays in Java without built-in functions
    November 16, 2019
© Selenium Webdriver Appium Complete Tutorial 2025