XMouseWheel does not work for me - Desktop Mode Active

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:

{
“Name”: “Scroll to next page 17”,
“CreationDate”: “2023-6-13”,
“Commands”: [
{
“Command”: “XClick”,
“Target”: “348,216”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN} ${KEY_DOWN}”,
“Value”: “”,
“Description”: “”
}
]
}

Basically I’m clicking the down arrow 17 times to get to the next page.
When I use this Xmousewheel, nothing happens:

{
“Name”: “Scroll by 17 -1”,
“CreationDate”: “2023-6-13”,
“Commands”: [
{
“Command”: “XMove”,
“Target”: “348,216”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “XMouseWheel”,
“Target”: “-500”,
“Value”: “”,
“Description”: “”
}
]
}

Can someone help me out here. I need to scroll to an exact position so the next link can be clicked at coordinates 348,216

Can you please post a video of this situation?

Hi @Plankton - I created a video. Please see link below.

The Mousewheel feature work in my Slack application but not on this PDF or any other applications I’ve tried.

I may need to record another video with the cursor showing.

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.

@newuserkantu - I tried this method but UI Vison had a hard time locating the scroll bar. Any suggestions on how you’ve done this before?

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.

You can try to use Xclick with x/y coordinates
It’s not an easy work but you can find a solution doing various tests

Here info
https://ui.vision/rpa/docs/xclick

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.