Ranorex 3.0 issue with Ranorex.Core.PathBuildMode.Reduce

Bug reports.
User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Ranorex 3.0 issue with Ranorex.Core.PathBuildMode.Reduce

Post by Ciege » Thu Mar 03, 2011 12:07 am

Just installed 3.0 and began testing with it... I am having an issue with this following line of code:

Code: Select all

Ranorex.Row HDTableRow = Host.Local.FindSingle(HDTable.GetPath(Ranorex.Core.PathBuildMode.Reduce).ToString() + "/row[@accessiblename='NewItem Row']", 30000);
In short, I get a Ranorex.ElementNotFoundException. This worked fine in 2.3.

Here is the full exception:

Code: Select all

Ranorex.ElementNotFoundException: No element found for path '/form[@controlname='frmMainDialog']/element/form/container/tabpagelist/tabpage[@controlname='mTabPageInstalledMaterial']/element/table[@accessiblename='Find:']/row[@accessiblename='NewItem Row']' within 30s.
at Ranorex.Core.Element.FindSingle(RxPath path, Duration timeout)
at Ranorex.Adapter.FindSingle(RxPath path, Duration timeout)
at Package_Price_Quote_Reg_Test.Program.CreateNewResource(Form HDClientForm, String strResourceRateType, String strResourceCode, String strDescription, String strDefaultQuantity, String strUnitOfMeasure) in \\XPRNRX\projects\Package Price Quote Reg Test\Package Price Quote Reg Test\Program.cs:line 16535

RanorexSpy does indeed show a different xPath for the element:

Code: Select all

/form[@controlname='frmMainDialog']/element/form/container/tabpagelist/tabpage[@controlname='mTabPageInstalledMaterial']/element/table/container[@accessiblename='Data Panel']/row[@accessiblename='NewItem Row']
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex 3.0 issue with Ranorex.Core.PathBuildMode.Reduce

Post by Support Team » Thu Mar 03, 2011 10:42 am

Ciege wrote:RanorexSpy does indeed show a different xPath for the element
Right, this is one of the breaking changes when you switch from 2.X to 3.X. We had to introduce some breaking changes when we fixed bugs in the element recognition, in particular with MSAA elements. Please, see the breaking changes listed in the Ranorex 3.0 release notes.
So this issue has nothing to do with Ranorex.Core.PathBuildMode.Reduce :)

For that breaking change, you can instruct Ranorex 3.0 to use legacy 2.X mode by setting following flag in your code:
Ranorex.Plugin.MsaaFlavor.Instance.FilterCompatibiltyLevel =
    Ranorex.Plugin.MsaaFlavor.CompatibilityLevel.V2X;
Regards,
Alex
Ranorex Team
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex 3.0 issue with Ranorex.Core.PathBuildMode.Reduce

Post by Ciege » Thu Mar 03, 2011 4:01 pm

Your link for the v3 release notes does not work. It is instead taking me to the "Creating Ranorex Snapshot Files" page.

I've looked and cannot immediately find the v3 release notes that would describe these breaking issues that I need to be aware of.


OK, I found them linked through the 3.x and 2.3.9 email that was sent out last night. Thanks, I'll give them a look.

--Edit

Do I just add the flag "Ranorex.Plugin.MsaaFlavor.Instance.FilterCompatibiltyLevel = Ranorex.Plugin.MsaaFlavor.CompatibilityLevel.V2X;" to the top of code?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex 3.0 issue with Ranorex.Core.PathBuildMode.Reduce

Post by Support Team » Thu Mar 03, 2011 4:10 pm

Ciege wrote:Your link for the v3 release notes does not work. It is instead taking me to the "Creating Ranorex Snapshot Files" page.
Sorry, this is the correct link (I also corrected the link in my previous posting):
http://www.ranorex.com/download/release ... html#c3330
Ciege wrote:Do I just add the flag "Ranorex.Plugin.MsaaFlavor.Instance.FilterCompatibiltyLevel = Ranorex.Plugin.MsaaFlavor.CompatibilityLevel.V2X;" to the top of code?
Right.

Regards,
Alex
Ranorex Team
.
Image

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex 3.0 issue with Ranorex.Core.PathBuildMode.Reduce

Post by Support Team » Tue Mar 08, 2011 7:54 pm

Ciege wrote:Do I just add the flag "Ranorex.Plugin.MsaaFlavor.Instance.FilterCompatibiltyLevel = Ranorex.Plugin.MsaaFlavor.CompatibilityLevel.V2X;" to the top of code?
A short follow-up on the "FilterCompatibilityLevel" and the breaking changes for MSAA elements with Ranorex 3.X: Settings this property will make your 2.X RanoreXPaths work instantly with Ranorex 3.X. However, Ranorex Spy will still show you the 3.X RanoreXPaths. Consequently, using this flag is not recommended if you continue to work on that project, you should rather update the broken RanoreXPaths.

BTW, when I tried to reproduce the problem from your other post, I used Ranorex 3.X with one of your projects and only had to change one of your methods (that gets cells from a table) in order to make it work. In your example above it should be sufficient to add another layer in order to find the cells, e.g.:
"/*/row[@accessiblename='NewItem Row']"

Regards,
Alex
Ranorex Team
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex 3.0 issue with Ranorex.Core.PathBuildMode.Reduce

Post by Ciege » Tue Mar 08, 2011 7:59 pm

Well that's good news... As soon as the 3.0.1 releases I'll get to that and go from there.

Thanks!
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...