Search code examples
qtphp-uft

How to test the functionality of page scroll using QTP?


I am automating a web application and in one of the page contains lengthy content, so user need to use the scrollbar to read through the whole content. Now at the top of the page there is a link available named as "Bottom", on clicking this link user will go the bottom of the page. Similarly at the bottom of the page there is a link available named as "Top", on clicking this link user will go the top of the page.

I need to check if these 2 links are working fine. I can't use Exist or GetRoProperty("visible") as these will return True always. Kindly help me how to automate this functionality using QTP. Thanks in advance!


Solution

  • You check the difference in y values of the top and bottom objects. I had a similar problem long back. So, if you are at the bottom of the page with "Top" button visible- use getROproperty to get the value of Y for "Bottom" button. It should probably give 0 as "Bottom" is not on the screen. Now click on Top button. "Bottom" should become visible now- do a getROproperty to get the value of Y for "Bottom" button. You will get a meaningful value. May be this comparison can help you in implementing a indirect checkpoint for your scenario. This is just one way, I am sure there would be some more better ways to implement this checkpoint.