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
modal window hidden instead of closed
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: modal window hidden instead of closed
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?
Regards,
Markus
Ranorex Support Team
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
-
- Posts: 25
- Joined: Tue Mar 08, 2011 11:07 am
Re: modal window hidden instead of closed
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
I have been looking in the properties and cannot find 'use ensure visible'.
Can you tell me where I find this?
Thanks
Chris
-
- Posts: 25
- Joined: Tue Mar 08, 2011 11:07 am
Re: modal window hidden instead of closed
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
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
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: modal window hidden instead of closed
Hi,
have you tried to use the code Markus has mentioned in his last post:
Tobias
Support Team
have you tried to use the code Markus has mentioned in his last post:
Regards,Support Team wrote:repo.YourButton.Focus(); //or repo.YourButton.EnsureVisible(); //Before doing the Click Action: repo.YourButton.Click();
Tobias
Support Team
-
- Posts: 25
- Joined: Tue Mar 08, 2011 11:07 am
Re: modal window hidden instead of closed
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
I haven't tried that code yet. Can you tell me which file its updated to please.
Is it the repository.rxrep?
Thanks
Chris
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: modal window hidden instead of closed
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
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