Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compare two stored texts in Selenium IDE?

How can I compare two stored texts and if they are equal to echo some result?

like image 632
Stanimir Yakimov Avatar asked Feb 14 '23 12:02

Stanimir Yakimov


1 Answers

You can use the verifyEval command to compare two variables:

store | text | i
store | different text | j
verifyEval | storedVars['i']==storedVars['j'] | true

Running this script as written will cause the test to fail with [error] Actual value 'false' did not match 'true'. Change j to text, and it will complete without error.

Note that this can also be used to verify that two strings are not equal, by changing true to false in the verifyEval command.

like image 59
Tetrinity Avatar answered Apr 26 '23 07:04

Tetrinity