We have already seen examples of "assertElementHeight" and "assertElementWidth" commands. In those examples, we have seen that "assertElementHeight" and "assertElementWidth" commands will pass if expected and actual height or width of element will match. Else it will fail and return error message and
selenium IDE will stop execution. "assertNotElementWidth" and "assertNotElementHeight" commands are working opposite to "assertElementHeight" and "assertElementWidth" commands.
"assertNotElementWidth" Command
"assertNotElementWidth" command will pass if element's actual width will not match with expected width provided in value column. If both will match then selenium IDE will return error message like '[error] Actual value '35' did match '35'' and stop the execution. This command is used only some times in your software web application regression testing.
"assertNotElementHeight" Command
"assertNotElementHeight" command Works same as "assertNotElementWidth" command but for the height of element.
Run bellow given examples in your selenium IDE and observe function of both the commands.
New Test | ||
Command | Target | Value |
open | http://only-testing-blog.blogspot.com/2013/11/new-test.html | |
storeElementWidth | css=input[type="button"] | i |
echo | ${i} | |
storeElementHeight | css=input[type="button"] | j |
echo | ${j} | |
assertNotElementWidth | css=input[type="button"] | 34 |
assertNotElementWidth | css=input[type="button"] | ${i} |
assertNotElementHeight | css=input[type="button"] | ${j} |
assertNotElementWidth | //input[@value='<-'] | 34 |
assertNotElementWidth | //input[@value='<-'] | 24 |
In above example, 1st "assertNotElementWidth" command will pass because actual width of button is 35 and we have expected 34 in script. But next 2nd "assertNotElementWidth" will fail because both the values will match. Same thing will happen in bellow given example for "assertNotElementHeight" command.
New Test | ||
Command | Target | Value |
open | http://only-testing-blog.blogspot.com/2013/11/new-test.html | |
storeElementWidth | css=input[type="button"] | i |
echo | ${i} | |
storeElementHeight | css=input[type="button"] | j |
echo | ${j} | |
assertNotElementHeight | css=input[type="button"] | 22 |
assertNotElementHeight | css=input[type="button"] | ${j} |
assertNotElementWidth | //input[@value='<-'] | 34 |
assertNotElementWidth | //input[@value='<-'] | 24 |
No comments:
Post a Comment