Page 1 of 1

Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Sun Jul 14, 2019 8:39 pm
by matthias.scherzinger
Hallo togther
I Update my RX Project from 6 to 9.
After that the mehtod Host.Local.TryFindSingle dose not work anymore.
When I use the Same RX Path in Spy i got the object in around 900ms.
With the Host.Local.TryFindSingle method I got only null

Was thair anny change in the newer Versions of Ranorex?

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Mon Jul 15, 2019 8:11 am
by odklizec
Hi,

Please upload a Ranorex snapshot, containig the problematic element. Plus show us the xpath, you are looking for and the piece of code, which is searching for the element. Ideally, post entire solution. If you can't post your production solution, create a small sample solution, featuring problematic code, xpath and eventually 3rd party app or web page, we can look at. Thanks.

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Mon Jul 15, 2019 6:17 pm
by matthias.scherzinger
Hi Thx for the fast Response

some Update to my Case.

I get the Object but only if I'm not in debug mode.

The amazing thing is if I use a Repository and use the Paht of the Object with the TryFindSingle Method I get null.

If I try to use the object direct from the repository its works.

Any Idea

My Path is "/form[@controlname='MDIParent2']/?/?/form/?/?/container[@controlname='GUITransparentProxy']/container[@controltypename='DtmUserInterface']/container[@controlname='AboutBoxPresentation']"

Ranorex Version 9.1
Windows 10 Enterprise 1903
Hardware: VmWare

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Mon Jul 15, 2019 6:58 pm
by odklizec
Hi,

As mentioned before, please upload a Ranorex snapshot (NOT screenshot) of the problematic element. Without, at very least, snapshot, it’s impossible to tell what’s wrong.

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Tue Jul 16, 2019 9:32 am
by matthias.scherzinger
Attached you can find the Snapshot

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Tue Jul 16, 2019 9:43 am
by odklizec
Hi,

Looking at your code and snapshot you posted, I think the problem is that you are using too short timeout for TryFindSingle method. 2000ms is really too short timeout and may result to not found element. Have you tried to increase the timeout to 30s or longer? Ideally, try the same timeout value as is the Effective Timeout for given repository element. I'm sure that while using repository element in code, it takes longer than 2s to find the item? Just check the test progress bar or timing in report ;)

BTW, to increase the speed of element search, try to add your app (process name FMPFrame) to Ranorex whitelist. This should significantly increase the speed of search, so you may be able to use shorter timeout for TryFindSingle. Honestly, I would personally use, at very least, 30s timeout ;)

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Tue Jul 16, 2019 2:25 pm
by matthias.scherzinger
Hi THX for the hint

I head general issue with all item without a timeout definition.
Also the issue was that for the first element I got a technical limitation message . This limitation message takes around 8s after that the Item detection time was back to 900ms.

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Tue Jul 16, 2019 2:41 pm
by odklizec
Hi,

So it's OK now with increased timeout?

BTW, if I were you, I would consider making the whole code simpler, by using Exists() method and mainly, using repoiteminfo element instead of hard-coding repo element directly in code. Here is what I'm often using in my tests...

Code: Select all

public static void CheckIfExists (RepoItemInfo repoElement)
{
    if (repoElement.Exists())
    {
        repoElementLBL.CreateAdapter<Ranorex.Unknown>(false).Focus();
        Report.Success("Element found");
    }
    else
    {
        Report.Failure("Element not found");
    }
}

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Mon Jul 22, 2019 3:56 pm
by matthias.scherzinger
Hi
I'm still fighting.

I have the Issue that I find the elements in Spy really fast but when I execute my code no element is find also with a timeout over 60s

I already have the rxsetting file in my solution.

My expectation is that my code has the same behavior then Ranorex Spy.

Any Idea what I doing wrong?
The hole test application working fine with Ranorex 6.1.

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Tue Jul 23, 2019 9:46 am
by matthias.scherzinger
Hi I Think I find a Solution ....

Temporary.

I downgrade my Windows 10 to 1809. Now everything ist working. Properly there is an issue with Ranorex 9.1 and Windows 10 1903

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Tue Jul 23, 2019 9:10 pm
by Vega
I already have the rxsetting file in my solution.
Have you tried making a brand new Ranorex solution and trying it? The very issue may be related to your rxsettings file. Keep in mind that there are two versions of Spy: internal and external. Internal is opened from within Ranorex Studio and external is opened from Start menu / desktop / shortcut etc.

The only difference between internal and external Spy is that they use different settings. External Spy will use the global system Ranorex settings while internal Spy will use your solution settings. Since you can find the elements in Spy but not your solution, I would guess that you are likely using external Spy which uses different settings than your solution settings Ranorex.rxsettings.

The best way to see if this is the issue, is to make a new solution (preferably in Ranorex Studio) and try to reproduce the problem.

Hope this helps

Re: Host.Local.TryFindSingle after update to Ranorx 9.x from 6.x

Posted: Mon Aug 05, 2019 9:41 am
by odklizec
Hi,

There was reported an element search slowdown related to administrator mode and Windows 10 1903
https://www.ranorex.com/forum/viewtopic ... 125#p55125