Ranorex Clicks top left window

Ask general questions here.
Juan
Posts: 19
Joined: Wed Jul 20, 2016 1:18 pm

Ranorex Clicks top left window

Post by Juan » Fri Aug 12, 2016 2:05 pm

Hi all.
I saw in the forum this problem but I can't solve it anyway. In C#, when I try to click the same item again, the mouse move to the top left corner. This is the example of my code:

Code: Select all

private void ElementClick(Editor edit)
{
IList<SpanTag> spinners = edit.Parent.FindDescendants<SpanTag>();
foreach (SpanTag label in spiiners)
{
  edit.Click();
  if (label.Class == "k-icon")
  {
     label.click();
     edit.Click(); <------------ This is the one which clicks at top left
I tried:

label.click();
Thread.Sleep(1000);
edit.Click();
-----------------------

label.click();
Thread.Sleep(1000);
edit.EnsureVisible();
edit.Click();

------------------------

label.click();
Thread.Sleep(1000);
edit.MoveTo();
edit.Click();
------------------------

and many examples like that. Any idea how can I manage this?

Thanks!!

User avatar
RobinHood42
Posts: 239
Joined: Fri Jan 09, 2015 3:24 pm

Re: Ranorex Clicks top left window

Post by RobinHood42 » Wed Aug 17, 2016 11:36 am

Hi Juan,

It seems that the element gets invalid after your first click. Have you tried turning off caching for your repository items as described here?

Hope that helps!?

Cheers,
Robin

Juan
Posts: 19
Joined: Wed Jul 20, 2016 1:18 pm

Re: Ranorex Clicks top left window

Post by Juan » Wed Aug 17, 2016 11:39 am

I tried with RepoItem.UseCache = false; but is not recognized by my code

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ranorex Clicks top left window

Post by krstcs » Wed Aug 17, 2016 2:22 pm

This is not a bug. Please ask questions in the appropriate forum.

@Ranorex team, can you move this to the General forum, please?

As for setting the UseCache property, you can do it through the repository. Select the folder and hit F4. In the properties window set UseCache to False.
Shortcuts usually aren't...

Juan
Posts: 19
Joined: Wed Jul 20, 2016 1:18 pm

Re: Ranorex Clicks top left window

Post by Juan » Thu Aug 18, 2016 11:52 am

I have to disable the cache by code. How?

jma
Posts: 111
Joined: Fri Jul 03, 2015 9:18 am

Re: Ranorex Clicks top left window

Post by jma » Fri Aug 19, 2016 2:13 pm

I just tried changing this property by code and it seems to work properly. Could you upload your repository file (*.rxrep) and post the corresponding line of code? Did you make sure that you changed the property for the correct repository item?

Juan
Posts: 19
Joined: Wed Jul 20, 2016 1:18 pm

Re: Ranorex Clicks top left window

Post by Juan » Thu Aug 25, 2016 10:49 am

I work via API ranorex, Is there any object or something that I can use to disable the cache?

jma
Posts: 111
Joined: Fri Jul 03, 2015 9:18 am

Re: Ranorex Clicks top left window

Post by jma » Fri Aug 26, 2016 8:53 am

It should work with the following line of code. Please note that you will need to adjust the code according to the name of your repository item.

Code: Select all

repo.SampleForm.UseCache=false;