How to set slider value on Ranorex?

Ask general questions here.
irem
Posts: 11
Joined: Fri May 25, 2012 12:40 pm

How to set slider value on Ranorex?

Post by irem » Wed May 30, 2012 7:52 am

Hello,

I am trying to set slider (volumeslider) value. How can i do this ? I used :

Mouse.ButtonDown -> Mouse.MoveTo -> Mouse.ButtonUp . However, slider's new value has not been correct.

Is another way available for this problem ?

Thanks in advance.

İrem.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How to set slider value on Ranorex?

Post by Ciege » Wed May 30, 2012 5:26 pm

So you want to set the volume on your computer?
Can you show the actual code that you are using...
And by "slider's new value has not been correct", what exactly do you mean? Is the volume slider not being set to where mouse.buttonup is releasing it?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

irem
Posts: 11
Joined: Fri May 25, 2012 12:40 pm

Re: How to set slider value on Ranorex?

Post by irem » Mon Jun 04, 2012 6:42 am

Hi,

I solved my problem. I was trying to change volume by taking forward slider's indicator. So I used this code :

Code: Select all

Indicator volumeSliderIndicator = slider.FindChild<Indicator>();   			
 			       		  
Mouse.MoveTo(volumeSliderIndicator.Element);
Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
Delay.Milliseconds(100);
	        	    
while( slider.Value < testValue ) {	       
    Mouse.MoveTo(new Point(Mouse.Position.X + 1, Mouse.Position.Y));
    Delay.Milliseconds(50);    	
}

Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);