Assert mechanism check the elements on the page and helps in carrying out the test successfully. This mechanism validates the elements on the page in the following way.

  1. Open Firefox and go to the Tools menu. From there launch Selenium IDE.

Note: You must install Selenium IDE to follow the steps.

  1. Ensure that the ‘Record’ option is enabled by default.
  2. Type google.com and press enter to open the Google home page.
  3. Right-click on the UI element that needs to be validated. IN this case, Google Logo needs to be validated.image001
  4.  Right-click menu options and select ‘Show All Available commands’.image002
  5. Select ‘AssertElementPresent’ from the sub-menu option of the ‘Show All Available commands’.image003
  6. Ensure that the ‘assertElementPresent’ is added in the Selenium IDE table tab.image004
  7. Turn off the recording process by clicking on the ‘Record’ button.image006
  8. Click ‘Play current test case’ on the Selenium IDE to run the recorded validation.image007
  9. Ensure that the ‘assertElementPresent’ command is reflecting in green color. Green indicates that the step has been passed.image008
  10. The ‘assertElementPresent’ command will reflect in red if the element is not present.image009
  11. If the test fails, it won’t execute the steps thereafter.