any way to make te auto scroll of page go past the element?

Advanced programming using WinTask scripting language

any way to make te auto scroll of page go past the element?

Postby denethor on Thu Feb 28, 2013 12:58 am

I have seen many sites where I need to click on something that is down the page off the screen, but ClickHTMLElement only scrolls just far enough to display the the element to click on it. I want to click something 50-70 pixels below the element, which is easily done with adding ,LEFT,x,y to the end of the ClickHTMLElement, but you can't click below an element because it doesn't scroll the window far enough.
You can't manually scroll the pagedown past the element as soon as the ClickHTMLElement executes, it scrolls the page back up to only barely show the element in question.

My issue is that there is a static text element that I can trigger off of, but the button I need to click is 70 pixels below that text and the button element changes on every page refresh so I can't just say click button HTML element.
denethor
 
Posts: 172
Joined: Thu Jul 20, 2006 7:29 pm
Location: North Carolina, USA

Re: any way to make te auto scroll of page go past the element?

Postby TechSupport on Thu Feb 28, 2013 8:57 am

Hello,

ClickHTMLELement automatically scrolls down, but yes if you need to move down the element instead of clicking it directly, it won't work.

The best way is to simulate a PageDown, here is an example:
StartBrowser("IE", "www.wintask.com", 3)
UseWindow(top$())
SendKeys("<PageDown>",Noactivate)

Regards.
WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am

Re: any way to make te auto scroll of page go past the element?

Postby denethor on Thu Feb 28, 2013 1:04 pm

That doesn't work, I've done that.
you page down to get it in view, then as soon as you send the clickhtmlelelment, it scrolls back up.

can we somehow make it scroll until the element is near the middle of the window instead of the bottom of the browser window?
That way things are clickable above and below.

Or if there is an extended ,LEFT/RIGHT,X,Y on the statement scroll down at least that much further?
denethor
 
Posts: 172
Joined: Thu Jul 20, 2006 7:29 pm
Location: North Carolina, USA

Re: any way to make te auto scroll of page go past the element?

Postby denethor on Thu Feb 28, 2013 1:35 pm

Here is the issue as best I can draw in ASCII
square of "x"= picture (random element every load)

xxxx text describing picture (always the same per picture so I can find this every time)
xxxx______________________________Bottom of browser window_______________________________
xxxx
xxxx Button that submits based on the above text (html element is randomly generated every page load)

The only static element I can trigger off of is the "text", but issuing a click on that scrolls it to the bottom, hiding the button.
denethor
 
Posts: 172
Joined: Thu Jul 20, 2006 7:29 pm
Location: North Carolina, USA

Re: any way to make te auto scroll of page go past the element?

Postby TechSupport on Fri Mar 01, 2013 6:21 pm

Hello,

I did it using a clickhtmlelement with an offset going up, and it clicks ok. If the offset goes down, it is confused with the taskbar and it's not correctly clicking. Here is the code:
StartBrowser("IE", "http://www.wintask.com/ocr-features.php", 3)

UsePage("OCR")
UseWindow(focus$(),topinstance())
SendKeys("<PageDown>",Noactivate)
Pause 3
ClickHTMLElement("A[INNERTEXT= 'Home',INDEX='2']", left,0,-80)

You will see that the mouse goes to the above link (or around depending on your screen resolution).

If you don't succeed, send us to info@wintask.com the web page. If it's not a public site, then save the page in offline format in order we can load it offline and play with it offline.

WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am

Re: any way to make te auto scroll of page go past the element?

Postby denethor on Fri Mar 01, 2013 8:54 pm

Yes, I stated that, clicking above is fine, clicking below tries to click the status bar of the browser. Hence scroll element to middle of screen instead of bottom, would allow up and down.
denethor
 
Posts: 172
Joined: Thu Jul 20, 2006 7:29 pm
Location: North Carolina, USA


Return to Scripts programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron