At first a small review about selenium commands.
A command tells Selenium what to do. There are three 'types' of Selenium commands: Actions, Accessors and Assertions. Each command must contain command name, target and value:
command target value
Accessors examine the state of the application and store the results in variables, e.g. "storeText". They are also used to generate Assertions automatically.
Assertions are like Accessors, but they verify that the state of the application is as expected. All Selenium Assertions can be used in 3 modes: "assert", "verify", and "waitFor".
"WaitFor" commands waits until some condition become true. When the condition becomes already true, test will succeed. If the condition has not become true within a specified time-out, test will be considered as failed.
If "verify" command is failed the test script continues to run with the entry in the error log.
If"assert" command is failed the test script is aborted.
Let’s look at the most frequently used “assert” command.