I’m trying to use XMouseWheel to scroll on a desktop application but I have never been able to get it working.
I’m building a bot click each link on a page but the page is very long and after the 37th link I need to scroll the down to get to the next 37 links to be clicked. Right now I using this script to achieve these result but it is not exact:
The nice thing about ui vision is that for every job there are many different ways to do it.
You can scroll the page easily using Xclick and clicking on the bar on the right of the screen, just a simple image or coordinates and you can scroll the page easily.
I never use ui vision mouse commands to automate instead I always use shortcuts which are much more precise and work well.
You can try doing this, click on the document (it looks like a pdf to me) and then with KEY_DOWN or KEY_PAGE_DOWN you can try to scroll the page.
Usually everything you do with the mouse can be done with shortcuts so you just need to find the right combination of keys.
Remember that the Xtype and Xmove commands require focus on the screen so when you use them you must not use the screen otherwise you will interfere with the automations
@newuserkantu thank you - I’m using a PDF for demostartion purposes but the actual environment I’m running the script on is in Citrix. In that environment there can be over 1000 links that need to be clicked and they are all on one page. I need a way to tell the automation to scroll a specific number of pixels or to an exact point to check to the next set of links that need to be clicked. I’ve used KEY_DOWN (17 times) but it’s not exact. The scroll bar may work so I may need to fiddle with that option.
If I could use window.scrollTo(0, 500) or window.scrollBy(x, y) it would work much better.
Read part
The raw way to send clicks by using x/y coordinates is also available. This can be useful if you know or can calculate the exact x/y position. For example, you can first do an image search, then calculate the coordinates as offset to this initial position. If you want to re-use x/y from a previous image search, you find them in ${!imagex} and ${!imagey}. Also, there are good tools to determine x/y manually. Note that in browser automation mode the XClick | 0,0 value is the top left of browser viewport. In desktop automation mode it is the top left of the main desktop.