Cannot do a vscroll on a winObject with QTP/UFT
Question ID: 105462
1
0

When I execute this line of code:
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").VScroll(micScrollEnd)
I get this message: The operation cannot be performed
The object can be identified from the object repository. Why won’t it do the scroll?

Marked as spam
Posted by (Questions: 45, Answers: 0)
Asked on July 2, 2014 5:23 pm
941 views
Answers (1)
1
Private answer

QTP does not have a built-in method or property to retrieve if the browser has a scrollable right scrollbar. QTP can query the Internet Explorer Document Object Model (DOM) to access the .ScrollTopproperty of the object containing the scrollbar.

Here are couple options I think you can try.

Use the MakeObjVisible method to scroll down


Browser(''browser'').Page(''page'').Image(''c'').MakeObjVisible  

Use the send key


Browser(''browser'').Page(''page'').highlight  
CreateObject(''WScript.Shell'').SendKeys ''{END}''  

or


set WshShell = CreateObject(''WScript.Shell'')  
WshShell.AppActivate ''Your Title in IE - Microsoft Internet Explorer''  
WshShell.SendKeys ''{PGDN}'' 'press the Page Down key  
Set WshShell = nothing  

To scroll the object into view, try the Highlight method.
Example:

Browser(''Browser'').Page(''Page'').WebCheckBox(''WebCheckBox'').Highlight  

If the Highlight method does not scroll the object into view, you can also try using the tab key to set focus to the object in question.
Example:

' In a .Net application, tab through the objects until the one you want is in focus.  
SwfWindow(...).Activate  
While SwfWindow(...).SwfEdit(...).GetROProperty(''focused'') = False  
SwfWindow(...).Type micTab   
Wend  

If you are working with a Web application inInternet Explorer, you can also use the scrollIntoView DOM method. (This method is not available to Netscape or Firefox.)
Example:

Browser(''Browser'').Page(''Page'').WebCheckBox(''WebCheckBox'').Object.scrollIntoView  

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on July 2, 2014 5:29 pm
0
That helps thank you
( at July 2, 2014 5:31 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top