Why doesn't this scroller work?

Ask general questions here.
testingtesting123
Posts: 1
Joined: Tue Dec 14, 2021 1:13 pm

Why doesn't this scroller work?

Post by testingtesting123 » Wed Jan 25, 2023 4:18 pm

Hello,

I recently discovered a snippet of code that I thought was fit for purpose but it doesn't seem to work. I am trying to move a slider from the bottom to the very top. The code I am using is:

Code: Select all

public static void Scroll(RepoItemInfo repoInfoElement, string Directon){
			if (repoInfoElement != null){
		    Ranorex.Unknown itemAdapter = repoInfoElement.CreateAdapter<Ranorex.Unknown>(false);    				
		    do {
		        switch(Directon)
		        	{
		        		case "up" : 
		        		Keyboard.Press("{PageUp}");
		        		break;
		        		case "down" : 
		        		Keyboard.Press("{Next}");
		        		break;
		        	}
		        		
		    } while (itemAdapter.Visible == false);
		    itemAdapter.Click();
		    }
		}
So within my test case I have passed through the parameters of the slider button element and the direction "up" but nothing happens. Am I missing something?

I have attached a screenshot of the slider E.G. I want the Priority to be moved to the top https://drive.google.com/file/d/1e5igM5 ... share_link
https://drive.google.com/file/d/1e5igM5 ... share_link

User avatar
doke
Posts: 89
Joined: Fri Mar 29, 2019 2:33 pm

Re: Why doesn't this scroller work?

Post by doke » Thu Jan 26, 2023 9:36 am

Hi,

which keys can you use to control the sliders with the keyboard ?

my expectation would be that you have record following actions :
-click one of these controls
-do a keypress (probably "up" or "down"; not "pageup" / "next" which are in the code ) for short time or till percentage counter is 100 or 0


regards,
Don