×

Selenium WebDriver Commands

Selenium WebDriver Commands:

As we learn previously in the Selenium-IDE tutorial, Selenium commands are the set of commands that are used to run a Selenium test script.

But whereas, Selenium WebDriver had a different set of commands to perform various actions.

As we are using Selenium WebDriver with Java, all the commands written in simple methods.

Note: A method is a collection of statements that perform some specific task without returning anything.

Before getting into the details of browser controls of Selenium WebDriver, we will recommend you to go through the Java programming OOPs (Object-Oriented Programming) concepts.

For a better understanding of the topic, you can also refer to the given link:  https://www.tutorialandexample.com/object-oriented-programming/.

Now, we will learn that how we can use methods of the WebDriver-

To see the methods of selenium WebDriver , firstly open the Eclipse IDE where we have a jar files of the selenium web driver.

After that, we create a driver object of web driver for any browser and type driver. 

And it will display all available methods in the web driver.

//create the chrome driver class

WebDriver driver=new ChromeDriver();

Selenium Web Driver Commands

Let us see an example form the below snapshot taken from Eclipse where

 example form the below snapshot taken

Method Name:

The Method name is used to access the method of any class, we need to create an object of a class, and then all the public methods will appear for the object.

Parameter

It is an argument that is used to perform a specific operation with the help of a method.

Return type

Return type defines the data type of a value return from the method.

If the void comes after the method, which means the function is returning no value.

Or, if it is returning a value, then the value will be displayed, e.g., getPageSource(): String.

Now, let us discuss the various controls command used in Selenium WebDriver.

The WebDriver r commands can be divided into the following parts i.e.

Selenium Web Driver Commands
  • Browser Controls
  • Navigation Controls
  • Web Element Controls

 

 


Related Topics

Advantages and Disadvantages of Selenium-IDE

Advantages and Disadvantages of Selenium-IDE Advantages of Selenium IDE: UI based record and playback tool. Easy to understand & developed a test script. Selenium-IDE test script export into web driver code & Selenium–RC It is...

1 minute read.

CSS Selector: Inner text in Selenium IDE

CSS Selector: Inner text The inner text is used to identify and create a CSS Selector using a string pattern of the HTML tag which is displayed on the web page. Syntax...

1 minute read.

Selenium-IDE Locators

Selenium-IDE Locators: Before we start learning about Selenium –IDE Locators, firstly we have to learn about UI elements. UI Elements -UI elements are the elements which are displayed on the web application....

1 minute read.

WebDriver Interface | Class Diagram

WebDriver interface/class diagram: The interface of WebDriver includes the following stages, which is as follows: Search Context Web driver Remote web driver Driver class Search Context  The first interface of the web driver class is search Context,...

2 minutes read.

WebDriver-Class Name Locator

WebDriver-Class Name Locator In this tutorial, we will learn about the Class name locator of selenium WebDriver. The Class Name locator is used to identify any element in UI based on the...

4 minutes read.

Selenium WebDriver- Radio button handling

Selenium WebDriver- Radio button handling In this tutorial, we will be learning about handling the radio button in selenium WebDriver. Let us take one example to give you a better understanding of...

3 minutes read.

Selenium WebDriver – Window handling

Selenium WebDriver – Window handling In this tutorial, we will understand how we can handle the window, multiple windows, and pop-ups in selenium WebDriver. We have different types of window, and pop-ups...

7 minutes read.

Selenium IDE Tutorial for Beginners

Selenium IDE Introduction Selenium IDE stands for Integrated Development Environment. Selenium-IDE is released in 2006 and developed by SHINYA [JAPAN] THOUGHTWORK Company. Selenium IDE implemented as a Firefox plug-in, and concedes the record, edit, and debug tests....

2 minutes read.

WebDriver-Name Locator:

WebDriver-Name Locator: The name locator is used to identify any element in UI with the help of the name backend attribute. The Syntax of the name attribute is as below: driver.findElement(By.name(“value of the...

4 minutes read.

CSS Selector Locator in Selenium IDE

It used to identify the web element based on HTML tag, id, class, and attributes. To describe the look and formatting of a document written in the markup language are known...

1 minute read.

Selenium Tool Suite

The selenium tool suite is a combination of multiple software tools, and the entire tools having a different approach to support automation testing. Selenium test tool suites are as follows- Selenium...

2 minutes read.

Selenium WebDriver- Microsoft Edge Browser

Selenium WebDriver- Microsoft Edge Browser: In this tutorial, we will learn how to launch the Microsoft Edge browser in the Selenium WebDriver. Before we start automating our test script with Microsoft Edge...

4 minutes read.

CSS Selector: Sub String in Selenium IDE

CSS Selector: Sub String CSS Selector Sub-string is used to match a partial string to locate a particular web element. There are three ways to match a substring using a CSS Selector. Match...

2 minutes read.

Selenium WebDriver – Web Element Controls

Selenium WebDriver – Web Element Controls A web element is an interface that is implemented by a remote web element class. The Web element control can be used to perform the data...

1 minute read.

Selenium WebDriver-CSS Selector locator

Selenium WebDriver-CSS Selector locator A CSS selector is used to identify the web element based on their “# id” and “. Class”, Html tags, and attributes. A CSS stands for Cascading Style...

1 minute read.

Name Locator in Selenium IDE

NAME LOCATOR: It is used to find the name in the web element. If we have multiple web elements of the same name, then the first matched element would be returned. Open the...

3 minutes read.

Selenium WebDriver-CSS Selector: Tag and Class

Selenium WebDriver-CSS Selector: Tag and Class We will locate the web element with the help of tag and class CSS selector in this section of the tutorials Where Tag and class are...

4 minutes read.

CSS Selector: ID in Selenium IDE

CSS Selector: ID The id attribute is used to identify the web element uniquely in the web pages. Syntax of ID Attribute:  [HTML tag][#][Value of ID attribute] The hash sign (#): it is mandatory while using the...

1 minute read.

Characteristics of Selenium IDE

Characteristics of Selenium IDE Selenium IDE is separated into different parts, each having their features and functionalities. The seven various components of Selenium IDE are as follows: MENU BAR: The menu bar is...

3 minutes read.

Data-Capture Controls Methods in Selenium WebDriver

Data-Capture Controls Methods: The data-capture controls are used to determine the text, size, location, and the CSS value of the web element, etc. Some of the most commonly used data-capture controls are...

7 minutes read.