Page 1 of 2

Ranorex takes too long to find element

Posted: Wed Jun 07, 2017 9:14 pm
by Formula1
I have click element "call item" in order to show more details in my script.
The element path is: element/element[@automationid='Inbox']/container/element/element[@classname='DualModeDataView']/element/list/listitem/element[@automationid='MediaCardItem1']

It takes too long (10 seconds) to find the element which caused some of my scenarios cannot be executed properly and failed. Please let me know if there's any way I can reduce the time.

Re: Ranorex takes too long to find element

Posted: Thu Jun 08, 2017 3:49 pm
by asdf
Hi Formula1,

Please post a snapshotof your application under test. Furthermore, please also post the RxPath of the element in question. This would allow us to check the robustness of your path.

Kind regards,
asdf

Re: Ranorex takes too long to find element

Posted: Thu Jun 08, 2017 4:22 pm
by Formula1
/form[@name>'Ignite' and @processid=$Pid]/element[@automationid='FeatureView']/element/element[@automationid='Inbox']
/container/element/element[@classname='DualModeDataView']/element/list/listitem
/element[@automationid='MediaCardItem1']

Re: Ranorex takes too long to find element

Posted: Thu Jun 08, 2017 4:33 pm
by Formula1
Image

Re: Ranorex takes too long to find element

Posted: Fri Jun 09, 2017 8:55 am
by odklizec
Hi,

Unfortunately, what you have posted is not a Ranorex snapshot, but screenshot! Screenshot is unfortunately not helpful. Please learn how to create Ranorex snapshot here:
http://www.ranorex.com/support/how-to-c ... pshot.html

Re: Ranorex takes too long to find element

Posted: Fri Jun 09, 2017 7:26 pm
by Formula1
I attached the Ranorex screenshot.
Also I am trying to locate the call item like the picture I posted before.However, it seems Ranorex can only locate to the list outside of the call item:
Image

I used another path to locate the call item element but it seems causes problems, takes a long time to find the element. The path is: /form[@name>'Ignite' and @processid=$Pid]/element[@automationid='FeatureView']/element/element[@automationid='Inbox']
/container/element/element[@classname='DualModeDataView']/element/list/listitem
/element[@automationid='MediaCardItem1']


Thank you

Re: Ranorex takes too long to find element

Posted: Mon Jun 12, 2017 2:23 pm
by asdf
Hi Formula1,

I would suggest trying to identify the "call" item with the new WPF Plugin. Therefore, please open the "Settings" and navigate to "Plugins". In the WPF section, set the WPFLegacyMode to "WPFImprovedOnly".
WPFImprovedOnly.png
Afterwards, try to track the element again.

Please let us know if this helps.

Regards,
asdf

Re: Ranorex takes too long to find element

Posted: Mon Jun 12, 2017 3:24 pm
by Formula1
Hello asdf,

I had a look at WPF section, I did not even see the option of "WPFImprovedOnly". Is it started being used in 7.0? The version I am using is 6 something.
Thank you

Re: Ranorex takes too long to find element

Posted: Tue Jun 13, 2017 8:16 am
by odklizec
Hi,

Yes, WPFImprovedOnly is a 7.x related thing. Please, always include the information about your actual version in the initial post. Also, old Ranorex versions are usually no longer supported, so you should upgrade to the newest version. Typically, Ranorex folks supports actual version and a version before the actual one. So currently, Ranorex supports 7.0.1 and 7.0.

Re: Ranorex takes too long to find element

Posted: Wed Jun 14, 2017 10:59 pm
by krstcs
Actually, I believe they support the last two two minor versions, so right now it's 6.2.1 and 7.0.1 (not 7.0.0).

Re: Ranorex takes too long to find element

Posted: Tue Jul 04, 2017 8:38 am
by kulwinder
Hello,

I have the same issue. I am using Ranorex 7.0.1 on Windows 10 app. All the objects are running very slow and taking 8-10 seconds for each click.

Below is the xpath in question:

.//container[@automationid='IdentifiedByOptionsList']/list[@automationid='ItemList']/container/listitem[@index='0']/checkbox[@text='Building Unit Plan']

I am just clicking on the checkbox here and it is taking 8-10 seconds to move in to second object.

Please help !!


Kulwinder

Re: Ranorex takes too long to find element

Posted: Tue Jul 04, 2017 8:57 am
by odklizec
Hi,

I'm not quite sure where is the problem? It takes too long to search the checkbox before click (by provided xpath) or after clicking the checkbox and accessing next element? In this case, please provide xpath for that second element and exact action you are trying to perform.

BTW, please upload a Ranorex snapshot (not screenshot!) so we can evaluate the xpath in AUT GUI structure.

Also, there is already Ranorex 7.1 available, so try it out. It's always a good idea to test the problem in latest available version.

Re: Ranorex takes too long to find element

Posted: Tue Jul 04, 2017 10:39 am
by kulwinder
odklizec wrote:Hi,

I'm not quite sure where is the problem? It takes too long to search the checkbox before click (by provided xpath) or after clicking the checkbox and accessing next element? In this case, please provide xpath for that second element and exact action you are trying to perform.

BTW, please upload a Ranorex snapshot (not screenshot!) so we can evaluate the xpath in AUT GUI structure.

Also, there is already Ranorex 7.1 available, so try it out. It's always a good idea to test the problem in latest available version.



Hi,

It takes too long to search the checkbox before click using xpath (.//container[@automationid='IdentifiedByOptionsList']/list[@automationid='ItemList']/container/listitem[@index='0']/checkbox[@text='Building Unit Plan']).


Currently, after 10 secs it is clicking on the checkbox. I am building a Ranorex snapshot, but it is taking too long with ~8000 elements.

Re: Ranorex takes too long to find element

Posted: Tue Jul 04, 2017 11:33 am
by odklizec
kulwinder wrote: I am building a Ranorex snapshot, but it is taking too long with ~8000 elements.
Well, this probably answers the question why it takes so long to find a particular element ;) The xpath is most probably not unique enough and so it may take some time to find the element. The snapshot you are creating will be most probably too big for direct upload to this forum, so you will have to use a file sharing service (like dropbox or onedrive) and post a link here. Thanks.

Re: Ranorex takes too long to find element

Posted: Tue Jul 04, 2017 12:26 pm
by kulwinder
odklizec wrote:
kulwinder wrote: I am building a Ranorex snapshot, but it is taking too long with ~8000 elements.
Well, this probably answers the question why it takes so long to find a particular element ;) The xpath is most probably not unique enough and so it may take some time to find the element. The snapshot you are creating will be most probably too big for direct upload to this forum, so you will have to use a file sharing service (like dropbox or onedrive) and post a link here. Thanks.

Hi,

Another issue. With the below code, i am not able to identity the Ranorex Class.

I need to know, what should come with Ranorex.XXXXXXXXXXXX in below highlighted text.



var jobList = repo.HAWKiV117071QA.JobList;

IList<Ranorex.Core.Element> firstcol = jobList.Find(".//listitem/text[6]");

for( int count=0; count<firstcol.Count;count++)
{

String colval = firstcol[count].GetAttributeValue("caption").ToString();

if(colval.Equals(copiedjobidforHAWKi))
{

int val=count+1;

Ranorex.wpfElement searchjobid = jobList.FindSingle(".//listitem["+val+"]/text");

searchjobid.Click();

found=true;
}