Page 1 of 1

Move Slider - Jslider

Posted: Fri Sep 23, 2016 7:07 am
by subodh4u7
Hi,

I have one java based application where slider is being used using JSlider as attached in the screenshot.

Ranorex spy is not able to identify the slider but its able to identify (0-4) as slider.

Please find the rxrep attached here as well.

I want to move the slider back and forth using automation. Can any one help me to solve this issue.

And also, there are slider with two handles and not able to recognize each handles individually and hence becoming hard to automate such cases. Any suggestion would be highly appreciated.

Re: Move Slider - Jslider

Posted: Fri Sep 23, 2016 7:41 am
by odklizec
Hi,

Could you please upload a Ranorex snapshot of the entire slider thing? Repository is not very useful here. If the "slider" button is not recognizable, you will most probably have to change the slider position by clicking at 0...4 positions? Eventually, set the slider position from code. But it's hard to tell without seeing the snapshot and ideally, also a small sample app featuring this slider element.

Re: Move Slider - Jslider

Posted: Fri Sep 23, 2016 8:48 am
by Martin
You might be able to set the TagValue which in turn will change the value for the slider.

But yeah, as odklizec said, can't confirm without a snapshot for the entire slider.

Re: Move Slider - Jslider

Posted: Fri Sep 23, 2016 9:13 am
by subodh4u7
I am afraid that I won't be able to share the snapshot because it shows the whole application snapshot and in turn could lead to violation of company policy.
odklizec wrote:Hi,

Could you please upload a Ranorex snapshot of the entire slider thing? Repository is not very useful here. If the "slider" button is not recognizable, you will most probably have to change the slider position by clicking at 0...4 positions? Eventually, set the slider position from code. But it's hard to tell without seeing the snapshot and ideally, also a small sample app featuring this slider element.

Re: Move Slider - Jslider

Posted: Fri Sep 23, 2016 9:26 am
by odklizec
Well, in this case, there is nothing else we can do for you. Without at least snapshot, it's next to impossible to suggest something reliable. You can either try to set the slider value by clicking the values 0...4 or using SetValue action, as suggested by Martin.

BTW, you can try to save the snapshot with unchecked setting option "Let snapshot contain complete ancestor tree" (Settings >> Advanced tab). This should minimize the snapshot footprint and the amount of elements saved in snapshot. Just make sure there is saved entire parent container, holding all slider elements. Simply track the parent container (Difference image), instead of just slider button).

Edit: I've found a jslider sample and if your slider is not something completely custom-made, SetValue should be the way to go. At least it worked for me.

Re: Move Slider - Jslider

Posted: Fri Sep 23, 2016 1:50 pm
by krstcs
Be aware that SetValue() (and other InvokeAction methods like Press()) may not fire all events related to entering the value as would keyboard or mouse entry, depending on how the AUT was coded and what element you are Invoking against. You may have to do those yourself.