Jump to content

Recommended Posts

Posted

i was trying to record to see if recorder can detect scrolloing so i recorded myself first opening a page on google chrome and then scrolling down and clicking on a link but when i tried to run the code the scrollling didnt work though it did perform rest of the actions then i tried to scrolll using keyboard keys and it worked so then my question is it just a problem with my pc not installing autoit properly or that function mouse scrolling dosent work in general or its just with google chrome that the scrolling function has problems 

Posted

I don't use the recorder much but as far as I am aware it does not record mouse scrolling. Here is an example using the MouseWheel function.

#region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=00000409)  ---

#region --- Internal functions Au3Recorder Start ---
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '')
If $aResult[1] <> '00000409' Then
  MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409->' & $aResult[1] & ')')
EndIf

EndFunc

Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc

_AU3RecordSetup()
#endregion --- Internal functions Au3Recorder End ---


;change for your computer
Run('"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"')

_WinWaitActivate("New Tab - Google Chrome","")
Send("{SHIFTDOWN}a{SHIFTUP}utoit{ENTER}")
_WinWaitActivate("Autoit - Google Search - Google Chrome","")


Send("{TAB}") ;<<<< tab needed to give window focus


#endregion --- Au3Recorder generated code End ---

;give time for page to load
Sleep(3000)

;scroll down
MouseWheel("down", 100)

 

Posted

ya i too tried using mousewheel function but it didnt work anywhere not just google chrome maybe my pc has got problems well i got a possible solution using 

#include <IE.au3>

 

$oIE = _IECreate("http://freshmeat.net/")

$oIE.document.parentwindow.scroll(0, $oIE.document.body.scrollHeight)

found it on googling a bit on forums this works pretty well 

Posted (edited)

If you are going to use IE functions and you are trying to click on a link then you should look at _IELinkClickByText and _IELinkClickByIndex in the help. That way you don't have to scroll at all.

Simple example.

#include <IE.au3>

$oIE = _IECreate("google.com")
_IELinkClickByText($oIE, "Images") <<<clicks on the image link

 

 

Edited by Herb191
Posted

ya well i tried using these functions for instagram page 

in their user profile if a person has many images you usually scroll down and more images load well thats what the scrolling was required for since i tried to use these functions to send a click on the load more more option they have at the bottom of page but when i run _IELinkClickByText  nothing happens _IE status shows no match found so m guessing its not a link n just a javascript function which gets active when it cumz in view or focus 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...