Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving scroll bar up and down by QTP in web page
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi,

I have to move the scroll bar of web page either up or down to make the required object visible.

I have used the below code but nothing is happening.

Code:
Browser("BrowserCellPhones").Page("PhonesPage").Object.body.doscroll "scrollbarPageUp"

Kindly help me whats wrong with the code I have used.

Regards,
Srini
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
If scroll bar script does not work then use "Send Keys" method of WSH.
Reply
#3
Solved: 10 Years, 8 Months, 3 Weeks ago
Thanks.

Below code is working perfectly.

Code:
Set Obj=Browser("BrowserCellPhones").Page("PhonesPage").Object.body
Obj.doScroll("pageUp")

Regards,
Srini
Reply
#4
Solved: 10 Years, 8 Months, 3 Weeks ago
Not sure if this intrests you..

Code:
Extern.Declare micVoid, "mouse_event", "user32.dll", "mouse_event", micLong, micLong, micLong, micLong, micLong
Const MOUSEEVENTF_WHEEL = 2048 '@const long | MOUSEEVENTF_WHEEL | middle button up
Const POSWHEEL_DELTA = 120 '@const long | POSWHEEL_DELTA | movement of 1 mousewheel click Down<nl>
Const NEGWHEEL_DELTA = -120 '@const long | NEGWHEEL_DELTA | movement of 1 mousewheel click Up<nl>

Sub MouseWheelRot(iClicks)

dim iLoop
dim bPos

if iClicks > 0 then
bPos = true
end if
for iLoop = 1 to abs(iClicks)
if bPos then
Extern.mouse_event MOUSEEVENTF_WHEEL,0,0,POSWHEEL_DELTA,0
else
Extern.mouse_event MOUSEEVENTF_WHEEL,0,0,NEGWHEEL_DELTA,0
end if
next
End Sub

The above function causes the mousewheel to rotate...i have used this long ago..but i guess -5 would be the end of the rotation.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Web page not loading for EBS application when open UFT satyagadam 1 1,619 09-18-2019, 02:30 AM
Last Post: satyagadam
  Scroll Browser to display Specific Row in WebTable kdunn 3 3,411 06-15-2018, 04:07 AM
Last Post: Ankur
  Facing a problem while identifying Angular JS objects in a web page vangasantosh 0 1,111 12-20-2017, 01:26 PM
Last Post: vangasantosh
  IE 11 Download Notification bar identification using UFT 12.52 Sumana 1 3,657 03-09-2016, 09:43 AM
Last Post: supputuri
  How to get URL/Location from Address bar of any open window in Windows 7 kalpmist 0 4,084 05-11-2015, 07:23 PM
Last Post: kalpmist

Forum Jump:


Users browsing this thread: 1 Guest(s)