modal window hidden instead of closed : Automation Tools

modal window hidden instead of closed

Ranorex Spy, Recorder, and Studio.

modal window hidden instead of closed

Postby Chris Wright » Fri Nov 04, 2011 11:56 am

Hi,

Hopefully someone can help.

I have recorded a test where our application opens one modal window and then another modal window from that. A test is recorded where the active window has an item selected and then the 'ok' button should be clicked to close the window.

However on playback the test selects the item but will not click the OK button, instead it hides the active modal window behind the application, making the whole app inactive.

I have tried several different recording methods in Ranorex to try and get round this with no luck.

Cheers
Chris
Chris Wright
 
Posts: 25
Joined: Tue Mar 08, 2011 12:07 pm

Re: modal window hidden instead of closed

Postby Support Team » Fri Nov 04, 2011 2:08 pm

Hi,

Do you have tried to call "Focus() or EnsureVisible()" before you click on the Button, because it seems that Ranorex loses the focus of the button?
repo.YourButton.Focus();
OR
repo.YourButton.EnsureVisible();
AND
repo.YourButton.Click();

You can also try to set the "Use Ensure Visible" property of your repository item to true.

Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: modal window hidden instead of closed

Postby Chris Wright » Fri Nov 04, 2011 5:44 pm

Thanks for your responce.

I have been looking in the properties and cannot find 'use ensure visible'.
Can you tell me where I find this?

Thanks
Chris
Chris Wright
 
Posts: 25
Joined: Tue Mar 08, 2011 12:07 pm

Re: modal window hidden instead of closed

Postby Chris Wright » Fri Nov 04, 2011 6:17 pm

Apologies, I have found this property now but unfortunately setting it to true does not solve the problem.

It actually looks like the replay is attempting to click the OK button on the window beneath rather than the OK button on the window in focus.

Cheers
Chris
Chris Wright
 
Posts: 25
Joined: Tue Mar 08, 2011 12:07 pm

Re: modal window hidden instead of closed

Postby Support Team » Mon Nov 07, 2011 1:27 pm

Hi,

have you tried to use the code Markus has mentioned in his last post:
Support Team wrote:
repo.YourButton.Focus();

//or

repo.YourButton.EnsureVisible();

//Before doing the Click Action:

repo.YourButton.Click();



Regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: modal window hidden instead of closed

Postby Chris Wright » Fri Nov 11, 2011 1:45 pm

Hi Tobias,

I haven't tried that code yet. Can you tell me which file its updated to please.

Is it the repository.rxrep?

Thanks
Chris
Chris Wright
 
Posts: 25
Joined: Tue Mar 08, 2011 12:07 pm

Re: modal window hidden instead of closed

Postby Support Team » Fri Nov 11, 2011 3:01 pm

Hi,

You can add a "User Code" to your Recording, just click on "Add New Action" and select "User Code". After you added a method name you can add these mentioned code to the specific created method in the "Recording1.UserCode.cs" file.

Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 0 guests