Ranorex takes too long to find element

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Formula1
Posts: 5
Joined: Wed Jun 07, 2017 9:05 pm

Ranorex takes too long to find element

Post by Formula1 » Wed Jun 07, 2017 9:14 pm

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.

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Ranorex takes too long to find element

Post by asdf » Thu Jun 08, 2017 3:49 pm

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

Formula1
Posts: 5
Joined: Wed Jun 07, 2017 9:05 pm

Re: Ranorex takes too long to find element

Post by Formula1 » Thu Jun 08, 2017 4:22 pm

/form[@name>'Ignite' and @processid=$Pid]/element[@automationid='FeatureView']/element/element[@automationid='Inbox']
/container/element/element[@classname='DualModeDataView']/element/list/listitem
/element[@automationid='MediaCardItem1']

Formula1
Posts: 5
Joined: Wed Jun 07, 2017 9:05 pm

Re: Ranorex takes too long to find element

Post by Formula1 » Thu Jun 08, 2017 4:33 pm

Image

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex takes too long to find element

Post by odklizec » Fri Jun 09, 2017 8:55 am

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
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Formula1
Posts: 5
Joined: Wed Jun 07, 2017 9:05 pm

Re: Ranorex takes too long to find element

Post by Formula1 » Fri Jun 09, 2017 7:26 pm

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
Attachments
Call Item.rxsnp
(940.39 KiB) Downloaded 30 times

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Ranorex takes too long to find element

Post by asdf » Mon Jun 12, 2017 2:23 pm

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
WPFImprovedOnly.png (22.45 KiB) Viewed 1326 times
Afterwards, try to track the element again.

Please let us know if this helps.

Regards,
asdf

Formula1
Posts: 5
Joined: Wed Jun 07, 2017 9:05 pm

Re: Ranorex takes too long to find element

Post by Formula1 » Mon Jun 12, 2017 3:24 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex takes too long to find element

Post by odklizec » Tue Jun 13, 2017 8:16 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

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

Re: Ranorex takes too long to find element

Post by krstcs » Wed Jun 14, 2017 10:59 pm

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).
Shortcuts usually aren't...

kulwinder
Posts: 5
Joined: Tue Jul 04, 2017 5:25 am

Re: Ranorex takes too long to find element

Post by kulwinder » Tue Jul 04, 2017 8:38 am

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex takes too long to find element

Post by odklizec » Tue Jul 04, 2017 8:57 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

kulwinder
Posts: 5
Joined: Tue Jul 04, 2017 5:25 am

Re: Ranorex takes too long to find element

Post by kulwinder » Tue Jul 04, 2017 10:39 am

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex takes too long to find element

Post by odklizec » Tue Jul 04, 2017 11:33 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

kulwinder
Posts: 5
Joined: Tue Jul 04, 2017 5:25 am

Re: Ranorex takes too long to find element

Post by kulwinder » Tue Jul 04, 2017 12:26 pm

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;
}