Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle scroll down in the web page
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi,
In order to capture a bitmap located at the end of the web page, I have to scrolldown the page (if not the code is not capturing the bitmap). How should I handle the scroll down operation in the script?

Can any one help me please?
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Does the object not have VScroll or HScroll. If not let me know i will put up a function which will simulate mouse whell scroll.
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
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
No, it does not.
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Allright..i will post the mouse wheel scroll function tommorow.
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
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
Mouse Wheel Rotation:

This will scroll a page as defined according to the mouse wheel rotation. A method which can be useful if you have not object scroll.

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>

'*****************************************************'*
' ** Max: MouseWheelRot(5); Min : MouseWheelRot(-5)
'*     positive and negative clicks exist, negative rotates wheel up: positive down
'*****************************************************

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

Helps?
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
#6
Solved: 11 Years, 4 Months, 3 Weeks ago
Thanks Basanth.
Reply
#7
Solved: 11 Years, 4 Months, 3 Weeks ago
if the object does not support Vscroll and Hscroll methods.

you can use NextPage or NextLine or Set(ex: set 20) methods
Reply
#8
Solved: 11 Years, 4 Months, 3 Weeks ago
Chandu,
I am really curious to know how the next page or line set method can be used to scroll. Would you please writeup the code with an example?
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
#9
Solved: 11 Years, 4 Months, 3 Weeks ago
Code:
Window("").swfscrollbar("").set 20
Window("").swfscrollbar("").NextPage
Window("").swfscrollbar("").NextLine

u can use any of those methods as per ur requirement
Reply
#10
Solved: 11 Years, 4 Months, 3 Weeks ago
How would you use this when you cant get the scroll bar object? Please read the questioners post.
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
  Can QTP handle slick grid table in a web page qtplearner88 2 4,564 10-01-2019, 10:44 AM
Last Post: shilpi952
  Take Entire screen shot including scroll bar. venkatesh9032 0 1,896 12-26-2016, 06:14 PM
Last Post: venkatesh9032
  DP Web Browser/Page issues rstimers 1 2,493 08-14-2015, 12:37 PM
Last Post: venkatesh9032
  How to Handle Modal Dialogs In QTP Jyobtech 0 2,497 07-22-2015, 01:22 AM
Last Post: Jyobtech
  How to handle KeyUp Event used in my App Hpqtp 3 4,040 07-03-2014, 05:25 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)