Link Text Locator in Selenium IDE

LINK TEXT

Link textlocator is used to identify only the weblink element based on the name of the link.

Whenever multiple links are there, it will not work; it will work only for one link (current page HTML Document).

  •  For other than link element, link text is not valid.
  •  When duplicate present in UI link text locator is not correct.

For our testing purpose, we are locating the business link present in the Google search page

  • Open the Firefox browser
  • Click on the Selenium icon, and it will open the Selenium IDE interface.
  • Click on the star recording button, and enter the base URL is https:/ /www.google.com/.
Link text locator
  • Click on the command text box and write the first command as:-

Command: o pen

Target: https://www.google.com/

linktext open command
  • This command loads the Google page on the Firefox browser.
  • After that right-click on the insert new command in selenium IDE interface and write the next command as:
Project locator

Command: verify element present

Target: linkText=Business

Command verify element present
  • Now, click on the stop recording button.
click on the stop recording button.

       And click on the Run Current Test button.

  • It will execute all of your inserted commands on the browser.
  • The Log pane is displaying the overall summary of the executed test scripts.
click on the Run Current Test button.
  • After that, click on the Find button to verify that the link is highlighted in the browser or not.
  • And you can see the results in the Brower as well.
click on the Find button to verify that the link is highlighted in the browser