HomeSelenium

New Selenium IDE – Using ‘verify’ command

New Selenium IDE – Using ‘verify’ command

Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.

verify is one of the commands in Selenium IDE.

The purpose of the verify command is to check the value stored in a variable is according to the expected result.

Difference between assert and verify commands

Though the purpose of assert and verify commands are same, verify command will act as a soft assertion.

If the verify command fails in Selenium IDE, the execution won’t stop and the steps which come after the failed verify step will be executed.

Whereas if the assert command fails during execution, the complete execution will stop there itself and the steps which come after the failed assert won’t be executed.

In this article, I am going to practically demonstrate verify commands in Selenium IDE for checking whether the retrieved title stored in a variable is according to the expected title text as shown below:

verify Selenium IDE - demo

Let’s get started.

New Selenium IDE – verify command

Follow the below steps for practicing verify command in Selenium IDE along with me:

1) Let’s write the below code in Selenium IDE to check whether the title of the page that got retrieved and stored in a variable is the same as the expected title text.

Command Target Value
open http://omayo.blogspot.com/
store title x
verify x omayo (QAFox.com)

After incorporating the commands in the above table, Our Selenium IDE should look like below:

verify Selenium IDE - typing

 

2) Run the test and observe that the test will be passed as the retrieved title of the page is same as the expected title text:

verify Selenium IDE - executed

We can intentionally fail this test by changing the expected value as shown below:

verify Selenium IDE - fail

 

Here concludes the practical demonstration of verify command in Selenium IDE for checking the value stored in a variable with the expected value.

As already explained above, verify command when failed won’t stop the complete execution and the steps which come after the verify command will be executed. Whereas assert command when failed will stop the complete execution and the steps which after the assert command won’t be executed. The below screenshot proves it:

verify Selenium IDE - difference

In the next article, I will practically demonstrate another Selenium IDE command.

Next Steps:

  • > Check complete Selenium Tutorial Contents here (Click here)

Please leave your questions/comments/feedback below.

Happy Learning 🙂

About Me > Arun Motoori

On a mission to contribute to the Software Testing Community in all possible ways.

Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.

If you like this article, share it on LinkedIn using the below button:

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *