SUBSCRIBE HERE TO GET POST UPDATES VIA EMAIL :

Delivered by FeedBurner

Selenium IDE - When to use "assertNotElementWidth" and "assertNotElementHeight" Commands

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
CommandTargetValue
openhttp://only-testing-blog.blogspot.in/2013/11/new-test.html
storeElementWidthcss=input[type="button"]i
echo${i}
storeElementHeightcss=input[type="button"]j
echo${j}
assertNotElementWidthcss=input[type="button"]34
assertNotElementWidthcss=input[type="button"]${i}
assertNotElementHeightcss=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
CommandTargetValue
openhttp://only-testing-blog.blogspot.in/2013/11/new-test.html
storeElementWidthcss=input[type="button"]i
echo${i}
storeElementHeightcss=input[type="button"]j
echo${j}
assertNotElementHeightcss=input[type="button"]22
assertNotElementHeightcss=input[type="button"]${j}
assertNotElementWidth//input[@value='<-']34
assertNotElementWidth//input[@value='<-']24

No comments:

Post a Comment