Parallel actions

Ranorex Studio, Spy, Recorder, and Driver.
m.laily
Posts: 2
Joined: Tue Jan 30, 2018 3:46 pm

Parallel actions

Post by m.laily » Tue Jan 30, 2018 4:25 pm

Hi,

I want to automate a test on a password field with a button that shows the clear text of the password when it is clicked. (It is not a toggle: the user has to maintain the mouse button down)

I have been able to automate everything I need but I haven't managed to do the "press on the button" action while executing the verification of the clear text.
It seems everything in Ranorex must be sequential :/

I tried to do it with user code, but I couldn't find a click duration parameter (the only duration is for the mouse move before the click).

Here is a snippet of my attempt with user code (it does not work because of the missing click duration I mentioned above):

Code: Select all

        public void MergedUserCodeMethod(RepoItemInfo clickToShowTextInfo, RepoItemInfo passwordBoxClearText)
        {
        	var asyncValidation = Task.Run(async () =>
			{
        	    await Task.Delay(1000);
				Validate.AttributeEqual(passwordBoxClearText, "Text", "coucou");
			});
        	
            clickToShowTextInfo.FindAdapter<Text>().Click(Duration.FromMilliseconds(3000));
        }
Is it possible to do what I want with Ranorex? Could anyone help me on this please?

Thanks.

ahoisl
Certified Professional
Certified Professional
Posts: 192
Joined: Fri Sep 07, 2007 8:16 am

Re: Parallel actions

Post by ahoisl » Tue Jan 30, 2018 11:28 pm

Why not just use a sequential approach like this:
Move To element -> Mouse Button Down -> Validate -> Mouse Button Up?
Just use the Recorder to generate the code for you, you can easily create Mouse.Down and Mouse.Up actions.

Parallel actions should be possible as well to some extent as long as you don't use the Mouse/Keyboard in both threads, but why think too complicated? :D

Regards,
Alex
Ranorex Team

m.laily
Posts: 2
Joined: Tue Jan 30, 2018 3:46 pm

Re: Parallel actions

Post by m.laily » Wed Jan 31, 2018 9:30 am

EDIT: I don't know if anyone had the time to see my previous reply, but please forget about it.

Oh, I was indeed over-complicating this! I did not realize I could change the click action to a mouse up then down independently!
Thanks!