TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Selenium IDE- Locating Strategies By Name

Selenium IDE- Locating Strategies By Name with Introduction, features, selenium basic terminology, what is selenium, selenium limitations, selenium vs qtp, tool suite, selenium ide, ide-installation, ide-features, ide-first test case, ide-commands, ide-creating test cases manually, ide-login test etc.

<< Back to SELENIUM

Selenium IDE- Locating Strategies (By Name)

  • The name locator type will locate the first element with a matching name attribute.
  • For example, name=username.

Let us consider an example on how to use name locator as a target for commands in Selenium IDE.

We will create a login test, so that you could get a better understanding of locating elements through name locator.

  • Launch Firefox browser.
  • Click on the Selenium icon present on the top right corner on your browser.
  • It will launch the default interface of Selenium IDE.
  • Click on the command text box present on the Test Script Editor Box.

Selenium IDE Locating Strategies By Name

Selenium IDE Locating Strategies By Name

For second command to be entered, we need a unique identification element for the Username text box which will help the IDE to identify the target location.

    • Right click on the "Username" text box and select Inspect Element.

Selenium IDE Locating Strategies By Name
    • It will launch a window containing all the specific codes involved in the development of the "Username" text box.

Selenium IDE Locating Strategies By Name
  • Pick element with the matching name attribute that contains the specific name for the "Username" text box.

Selenium IDE Locating Strategies By Name
  • Modify the properties of second command as:
    • Command: click at
    • Target: name=login
    • After execution, this command will click on the Username text box.

Selenium IDE Locating Strategies By Name

We will use the same element for our next command.

  • Modify the properties of third command as:
    • Command: type
    • Target: name=login
    • Value: username
    • After execution, this command will type the username in the Username text box

Selenium IDE Locating Strategies By Name

We will now add a command that will click on the "Password" text box. For this command, we need a unique identification for the "Password" field which will help the IDE to identify the target location.

    • Right click on the "Password" text box and select Inspect Element.

Selenium IDE Locating Strategies By Name
    • It will launch a window containing all the specific codes involved in the development of the "Password" text box.

Selenium IDE Locating Strategies By Name
    • Pick element with the matching name attribute that contains the specific name for the "Password" text box.

Selenium IDE Locating Strategies By Name
  • Modify the properties of fourth command as:
    • Command : click at
    • Target : name=passwd
    • Upon execution this command will click on the Password text box.

Selenium IDE Locating Strategies By Name

We will use the same ID element for our next command which involves typing the password as login credential.

  • Modify the properties of fifth command as:
    • Command : type
    • Target : name=passwd
    • Value : **********(User Login Password)
    • Upon execution this command will type the user password as the login credential.

Selenium IDE Locating Strategies By Name

At last, we need a unique identification element for the Login Submit button which will help the IDE to identify the target location.

    • Right click on the "Go" button and select Inspect Element.

Selenium IDE Locating Strategies By Name
    • It will launch a window containing all the specific codes involved in the development of the "Go" submit button.

Selenium IDE Locating Strategies By Name
    • Pick element with the matching name attribute that contains the specific name for the "Go" submit button.

Selenium IDE Locating Strategies By Name
  • Modify the properties of sixth command as:
    • Command : click at
    • Target : name=proceed
    • After execution, this command will click on the "Go" submit button.

Selenium IDE Locating Strategies By Name
  • Click on the "Run Current Test" button present on the tool bar menu of the IDE. It will execute all of your inserted commands on the browser and gives you an overall summary of the executed test script.
  • The Log pane displays the overall summary of the executed test scripts.

Selenium IDE Locating Strategies By Name

Thus, you can see that we have used name locator as a target for most of our Selenium commands.

Next TopicLocating by XPath




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf