×

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 Firefox browser
  • Click on the Selenium icon, and it will open the Selenium IDE interface.
  • Now go to the Test Script Editor Box and click on the command text box.
NAME LOCATOR
  • Write the first command as:-

Command: open

Target: https://login.yahoo.com

Command open
  • This command loads the login page of yahoo on Firefox browser.
  • Then right-click on the username textbox and,
  • Click on inspect Element (Q).
command loads the login page of yahoo on Firefox browser
  • You will get a window contains all the specific codes involved in the Development Tool of the Username text box.
  • Then drag your mouse over the developer tools; you will see the highlighted area of the username textbox on the yahoo page.
  • Then select the name attribute that contains the specific name for the Username text box.
You will get a window contains all the specific codes involved
  • Now write the second command in selenium –IDE interface:-

Command: click

Target: name=username

Command click
  • The username Textbox is clicked.
  • Then we have to enter data in the text box, so for this, we will use the same name element.
  • The third command is:

Command: type

Target: name=username

Value: username

e.g.-xyz11@yahoo.com

username Textbox is clicked.
  • Then right-click on the Next button and,
  • Click on inspect Element (Q).
right-click on the Next button
  • You will get a window contains all the specific codes involved in the Development Tool of the next button.
  • Then drag your mouse over the developer tools; you will see the highlighted area of the username textbox on the yahoo page.
  • Then select the name attribute that contains the specific name for the Next button.
You will get a window contains all the specific codes involved in the Development Tool of the next button
  • Now write forth command in selenium –IDE interface:-

Command: click

Target: name=sign in

  • It will lead you to the next button on the browser.
It will lead you to the next button on the browser
  • Then Right-click on the password textbox then,
  • Click on inspect Element (Q)
  • You will get a window contains all the specific codes involved in the Development Tool of the Password text box.
  • Drag the mouse over the developer tools; you will see the highlighted area of the password textbox on the yahoo page.
  • Then select the name attribute that contains the specific name for the Password text box.
Right-click on the password
  • Now write the fifth command in selenium –IDE interface:-

Command: click

Target: name=password

  • The password text box is clicked.
  • Then we have to enter data in the text box, so for this, we will use the same name element.
  • The sixth command is:

Command: type

Target: name=password

Value: User password

 e.g.-*********

enter data in the text box
  • Then Right-click on the Sign-Up button then,
  • Click on inspect Element (Q).
Right-click on the Sign-Up button
  • You will get a window contains all the specific codes involved in the Development Tool of the Sign-Up text box.
  • You have moved the mouse over the developer tools; you will see the highlighted area of the Sign-Up textbox on the yahoo page.
  • Then select the name attribute that contains the specific name for the Sign-Up text box.
specific name for the Sign-Up text box
  • Then we have to enter data in the text box, so for this, we will use the same name element.
  • The sixth command is:

Command: click

Target: name=verifyPassword

we have to enter data in the text box
  • And click on the Run Current Test button.
  • It will execute all the inserted commands on the browser.
  • The Log pane is displaying the overall summary of the executed test scripts.
  • And you can see the executed command results in the Brower as well.
click on the Run Current Test button

Related Topics

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.

Selenium WebDriver installation

Installation Steps of Selenium WebDriver In this tutorial, we will see the process of selenium webdriver installation. Selenium WebDriver installation process is done in four Stages: Java Installation (version 8 or higher version) Eclipse...

4 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.

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 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.

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.

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.

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.

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.

Selenium WebDriver-Alert Popup

Selenium WebDriver-Alert Popup  An alert popup is one of the small message boxes, which used to give some information to the user that displays on the browser. The Alert popup will be...

6 minutes read.

Selenium WebDriver - Google Chrome Browser

Selenium WebDriver - Google Chrome Browser In this tutorial, we will learn how to run our Selenium Test Scripts in the Google Chrome Browser. To implement the WebDriver protocol with the help...

3 minutes read.

Selenium WebDriver-CSS Selector: Tag and ID

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

4 minutes read.

Selenium WebDriver - Firefox or Gecko (Marionette) browser

Selenium web driver-Firefox or Gecko (Marionette) browser In this tutorial, we are going to learn how to run the Selenium WebDriver test script in the Firefox Browser using the Gecko Driver. Before going...

4 minutes read.

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.

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.

Selenium Testing

Selenium is a functional testing tool and compatible with non–functional testing tool. Selenium is free and not required any licensing. There are specified types of testing that can be automated using Selenium:-   Functional Testing: Checking every component...

3 minutes read.

Selenium WebDriver-CSS Selector: Substring Matching

CSS Selector: Substring Matching Selenium WebDriver In this tutorial, we will learn how to identify the web element using the substring method. A Sub-string contains three methods for identifying the web element...

9 minutes read.

Selenium Wait

In this tutorial, we will understand how we can avoid synchronization issues while executing the test script in a selenium WebDriver. Before going further in this tutorial, first, we will understand that...

10 minutes read.

Selenium IDE Commands

Selenium –IDE Commands (SELENESE): Selenese commands are the set of commands used in Selenium IDE. Selenese command has two parameters target and value. Selenese command tests the existence of UI elements based on their HTML tags,...

3 minutes read.

Selenium WebDriver- Checkbox handling

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

4 minutes read.