use "storeElementHeight" and "storeElementWidth" to measure element's height and width in selenium

"storeElementHeight" command

"storeElementHeight" command useful to measure the height of elements like button, textbox, images etc. You need to measure element's height and width in pixel to pixel testing. Using selenium, you can measure it very easily. "storeElementHeight" command returns height of targeted element and store it into variable specified in value field.

Here is the one simple example of measuring height of google search box(Text field). In bellow given example, "storeElementHeight" command will store height of search box into variable "i". "echo" helps you to see variable's value (height of an element).

New Test
CommandTargetValue
open
http://www.google.com/

storeElementHeightid=gbqfqi
echo${i}
storeElementWidthid=gbqfqj
echo${j}


"storeElementWidth" command

Same as "storeElementHeight" command, "storeElementWidth" command store element's width in to given variable in value field. In above example, "storeElementWidth" command will store width of search box into variable "j". "echo" helps you to see variable's value(width of an element).

No comments:

Post a Comment