UFT - Resolving scrolling issue if object is not visible



There are many times when an object gets the place changed based on the list getting longer on the same webpage, which creates the need to scroll down on the webpage for any automation script to perform any action on the object.

Many times we try to resolve this issue using the below code.

Set objShell=CreateObject("WScript.Shell")
objShell.SendKeys "{PGDN}"

But if the place is dynamic and the lists above that object gets bigger then it requires more page down which will be never ending story and requires maintenance every time.

So to resolve this issue we can use the below code which will take the pointer focus to the object.

Browser("<object properties>").Page("<object properties>").Webbutton("name:=Next").Object.Focus

After this you can perform any action on the object.

Comments

Post a Comment

Popular posts from this blog

How to create a zip folder using VBScript

how to access the excel file as database in UFT?