Hi
I am trying to run a procedure several times throughout a single test case.
It simply selects a few drop down boxes on a form and saves.
The first time it runs through the procedure everything works perfect. The second time it runs through, however, the mouse simply moves to the top left of the screen and thus the test case fails.
Below is the code I'm using.
var repo = Optisoft_NetRepository.Instance;
Validate.Exists(repo.OptisoftNET.ToDoBase.TxtDescription);
Validate.Attribute(repo.OptisoftNET.ToDoBase.TxtDescription, "Visible", true);
repo.OptisoftNET.PatientsBase.ToDo.MoveTo();
repo.OptisoftNET.PatientsBase.ToDo.Click();
repo.OptisoftNET.PatientsBase.btnTabNew.MoveTo();
repo.OptisoftNET.PatientsBase.btnTabNew.Click();
Key_Sequence_txtAlarm();
Mouse_Click_FirstType();
Mouse_Click_FirstPriority();
repo.OptisoftNET.ToDoBase.TxtDescription.MoveTo();
repo.OptisoftNET.ToDoBase.TxtDescription.Click();
repo.OptisoftNET.ToDoBase.TxtDescription.PressKeys("{LShiftKey down}T{LShiftKey up}est{Space}Alarm on a ToDo");
OptisoftStoredCode.ValidateDuringRecord_btnSave();
repo.OptisoftNET.btnSave.Click();
OptisoftStoredCode.ValidateBeforeRecord_btnSave();
repo.OptisoftNET.btnBack.Click();
Validate.Attribute(repo.OptisoftNET.PatientsBase.SelfInfo, "Visible", "True");
I have added validation into the code to check the 'Exists' and 'Visible' properties of the Combo Boxes I am trying to click but the test case fails on the 'Visible' check. I have therefore tried adding a delay into the procedure just in case the form hasn't had time to load properly but still no joy.
I can only assume that the procedure is trying to use the first instance of the form, which now is not Visible, but do not know how to create a new instance of the form, using the same procedure.
Help!!!!!!
Mouse moves to top left of screen
Re: Mouse moves to top left of screen
Try turning off caching for the items in your repository.
Right-click the item, select Properties. In the "Use Cache" field, set to "False".
See how that works.
It will probably be a bit slower, but Ranorex will now evaluate the XPath every time it encounters that item. With caching on, it only evaluates the item once and then tries to re-use that cached info every time.
Right-click the item, select Properties. In the "Use Cache" field, set to "False".
See how that works.
It will probably be a bit slower, but Ranorex will now evaluate the XPath every time it encounters that item. With caching on, it only evaluates the item once and then tries to re-use that cached info every time.
Shortcuts usually aren't...
-
- Posts: 2
- Joined: Fri Oct 11, 2013 8:39 am
Re: Mouse moves to top left of screen
Spot on, works a dream.
Thank you for your reply
Thank you for your reply
Re: Mouse moves to top left of screen
Great!
Unfortunately, there is not way to turn caching off globally (see http://www.ranorex.com/forum/disable-ca ... -t878.html), but you can turn it off on the items you are having issues with.
Also, if you are opening, closing, and re-opening an application in the same test, that will cause these kinds of issues because Ranorex will not be able to identify the NEW instance of the app if caching is enabled.
NOTE: As I said in my first post, disabling caching can cause the tests to go MUCH slower because Ranorex has to evaluate the RanoreXPath every time hit needs to find the object. This is why they don't have a global switch.
Unfortunately, there is not way to turn caching off globally (see http://www.ranorex.com/forum/disable-ca ... -t878.html), but you can turn it off on the items you are having issues with.
Also, if you are opening, closing, and re-opening an application in the same test, that will cause these kinds of issues because Ranorex will not be able to identify the NEW instance of the app if caching is enabled.
NOTE: As I said in my first post, disabling caching can cause the tests to go MUCH slower because Ranorex has to evaluate the RanoreXPath every time hit needs to find the object. This is why they don't have a global switch.
Shortcuts usually aren't...
Re: Mouse moves to top left of screen
Hello, I've been noticing this issue creeping into my framework recently and intermittently.
Different machines produce different responses in my application under test, but once I restart my machines I resolves itself temporally.
I am not using Ranorex Studio, I've imported the Ranorex DLL's into my Visual Studio project.
Considering there is an approach to fix this in the R.Studio:
"Try turning off caching for the items in your repository."
How can I do this using direct C# code? Do you have an example please?
Or is there code that can turn off caching globally for me? (Note I am aware of and except the potential increased run time)
Different machines produce different responses in my application under test, but once I restart my machines I resolves itself temporally.
I am not using Ranorex Studio, I've imported the Ranorex DLL's into my Visual Studio project.
Considering there is an approach to fix this in the R.Studio:
"Try turning off caching for the items in your repository."
How can I do this using direct C# code? Do you have an example please?
Or is there code that can turn off caching globally for me? (Note I am aware of and except the potential increased run time)
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Mouse moves to top left of screen
Hi benny28,
In order to turn off caching via code please to the following:
RepoItem.UseCache = false;
Regards,
Robert
In order to turn off caching via code please to the following:
RepoItem.UseCache = false;
Regards,
Robert
Re: Mouse moves to top left of screen
Hi there,
Aware this is quite an old thread, however this is still occurring to myself. There's no longer the option of turning the caching off (in code or in Ranorex Spy) that I can see and thus I have no idea how to resolve this.
Any and all help would be greatly appreciated.
Kind Regards.
Aware this is quite an old thread, however this is still occurring to myself. There's no longer the option of turning the caching off (in code or in Ranorex Spy) that I can see and thus I have no idea how to resolve this.
Any and all help would be greatly appreciated.
Kind Regards.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Mouse moves to top left of screen
Hi blackout,
The folder caching still exists and can be disabled by following these steps:
Regards,
Robert
The folder caching still exists and can be disabled by following these steps:
- • Right click on an App – or Rooted-Folder
• Set UseCache to false
• Choose properties
Regards,
Robert
You do not have the required permissions to view the files attached to this post.
Re: Mouse moves to top left of screen
Thanks for that, and my apologies.
In the earlier answers it said to 'Right click the item' within the repo, not the application or rooted folder in question thus I couldn't find the option.
That being said, it appears that I've had this set to 'False' from the get-go, and thus the caching doesn't seem to be the cause of my issue :-/
Kind Regards.
In the earlier answers it said to 'Right click the item' within the repo, not the application or rooted folder in question thus I couldn't find the option.
That being said, it appears that I've had this set to 'False' from the get-go, and thus the caching doesn't seem to be the cause of my issue :-/
Kind Regards.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Mouse moves to top left of screen
Hello blackout,
We will need further information in order to analyze your issue. May I ask you to write an email to [email protected]?
Thanks,
Robert
We will need further information in order to analyze your issue. May I ask you to write an email to [email protected]?
Thanks,
Robert