GroupBox sometimes container sometimes element

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

GroupBox sometimes container sometimes element

Post by WajdaW » Mon Oct 24, 2011 12:18 pm

I have some Excel plugin and Windows Forms dialog for configuration. Problem is that when I run excel and click on my configuration, group boxes in configuration form sometimes have RXpath
/element[@controlname='groupBoxServerSettings'] and sometimes /container[@controlname='groupBoxServerSettings'] so my RXpath cannot find them always.
Also all my controls in groupBox change path. For example. My textBox change paths into this two values:
text[@controlname='textBoxBaseUrl']/text and
element[@controlname='textBoxBaseUrl']/text

Is there a way to have Rxpath written in that way so it can detect any of those elements like:
(text | element)[@controlname='textBoxBaseUrl']/text and for groupBox

(element | container)[@controlname='groupBoxServerSettings']
Or to use some type that is more generic that both of these types so it will fit RXpath always.
Or can I specify somehow in my GUI part that to create always only container and text elements.
How to solve this?

Regards,

Vladimir Vajda

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: GroupBox sometimes container sometimes element

Post by Support Team » Mon Oct 24, 2011 1:54 pm

Hi,
WajdaW wrote:Or to use some type that is more generic that both of these types so it will fit RXpath always.
Or can I specify somehow in my GUI part that to create always only container and text elements.
How to solve this
Would it be possible to post us two Ranorex Snapshots of these two cases? It seems to be a .Net Framework issue.
Are you using different .Net Framework version for your application under test?
I guess the UI element identification capabilities for this control are limited. Therefore please take a look to following link http://www.ranorex.com/support/user-gui ... html#c3250

Regards,
Peter
Ranorex Team

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: GroupBox sometimes container sometimes element

Post by WajdaW » Tue Oct 25, 2011 11:16 am

"Are you using different .Net Framework version for your application under test? "
I haven't quite understood this. I'm using .NET framework 4 in all of my projects (development and test)

Here are snapshots.
Just forgot to say, I don't use native windows forms controls for check boxes, comboboxes and buttons. I have made my classes which extends win forms classes. Maybe that is a problem.
Maybe I need to override some property or method of these win forms classes for this to work properly.

Take a look at my snapshots.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: GroupBox sometimes container sometimes element

Post by Support Team » Tue Oct 25, 2011 12:26 pm

Hi,

Thank you for the snapshots. I saw you are currently working on Ranorex 3.0.2. I would suggest you to update to Ranorex 3.0.5 or if it's possible to Ranorex 3.1.1, because we fixed a lot of small issues for .Net 4.0 applications.

Regards,
Peter
Ranorex Team

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: GroupBox sometimes container sometimes element

Post by WajdaW » Thu Oct 27, 2011 1:20 pm

We have upgraded to Ranorex 3.1.1 but now we have problem with licence. Is it possible that our licence doesn't suites this version of Ranorex?

"I would suggest you to update to Ranorex 3.0.5 or if it's possible to Ranorex 3.1.1"
Why have you mentioned this part? Is the Ranorex 3.0.5 the latest version to which we can upgrade with this licence?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: GroupBox sometimes container sometimes element

Post by Support Team » Thu Oct 27, 2011 1:23 pm

Hi,
WajdaW wrote:Why have you mentioned this part? Is the Ranorex 3.0.5 the latest version to which we can upgrade with this licence?
This depends on your subscription. If you don't have a valid subscription you cannot install Ranorex 3.1.1. Therefore I told you if "it is possible". But it was my fault to not tell you that you need a valid subscription. Sorry for that. Therefore please uninstall this version and install Ranorex 3.0.5.

Thank you.

Regards,
Peter
Ranorex Team

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: GroupBox sometimes container sometimes element

Post by WajdaW » Thu Oct 27, 2011 3:27 pm

Ok, we just gained new licence that is compatibile with 3.1.1 Ranorex. Thanks for information about that. I'll try later if this version fixes my first problem with object identification.

Regards,
Vladimir Vajda

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: GroupBox sometimes container sometimes element

Post by WajdaW » Fri Oct 28, 2011 9:51 am

I installed and tried new Ranorex 3.1.1 but problem is still here. I provided snapshots of these two cases in attachment.
Just to say, when I start Excel normally I get snapshot where all controls are elements. But when I start excel using nunit test runner button controls are buttons and groupbox controls are containers.
I came to think that maybe some security issue is problem. I don't know, just guessing.

So here are snapshots, suggest what I can do. Is there a way to specify my RxPath that way to be able to find item whether it's path is container[xx] or element[xxx]?
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: GroupBox sometimes container sometimes element

Post by Support Team » Fri Oct 28, 2011 10:22 am

Hi,
WajdaW wrote:I came to think that maybe some security issue is problem. I don't know, just guessing.
This could be. Did you try to start your Excel application as administrator?
Do you know if UAC is enabled on your Windows 7 machine?

Regards,
Peter
Ranorex Team

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: GroupBox sometimes container sometimes element

Post by WajdaW » Fri Oct 28, 2011 10:37 am

I am administrator on that machine. UAC is turned off.

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: GroupBox sometimes container sometimes element

Post by WajdaW » Fri Oct 28, 2011 10:40 am

Is there a way to somehow specify role for my win forms components. I figured out that if a role of control is unknown it becomes element which is default. Can I specify in my win form code control role for this case?
Will this fix the problem?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: GroupBox sometimes container sometimes element

Post by Support Team » Fri Oct 28, 2011 10:52 am

Hi,

Please would you add following lines to your nunit app config.
<configuration>  
  <startup useLegacyV2RuntimeActivationPolicy="true">  
    <supportedRuntime version="v4.0"/>  
    <supportedRuntime version="v2.0.50727"/>  
  </startup>  
</configuration>
Just change the one of your nunit executable.

Regards,
Peter
Ranorex Team

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: GroupBox sometimes container sometimes element

Post by WajdaW » Wed Nov 02, 2011 1:24 pm

Thanks Peter. That solved the problem. :)

binonline
Posts: 12
Joined: Thu Apr 19, 2012 4:12 pm

Re: GroupBox sometimes container sometimes element

Post by binonline » Fri May 25, 2012 12:25 pm

I have now a very similar problem:
On one PC I could run the TestSuite with the Application under Test successfully. The I Installed RANOREX with a trial version on another machine, installed the same Application under Test and used the same TesSuite, which resides on a shared drive - so same app.config file.

on working PC:
RANOREX: 3.2.3.16825
.NET Runtime Verison: 4.0.30319.269
Working Application Address.JPG
on new (not worrking) PC:
RANOREX: 3.2.3.16825
.NET Runtime Verison: 4.0.30319.269
New Application Address.JPG
How to asure, that it's always referencing per container not elements :?:

Thx, Robert
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: GroupBox sometimes container sometimes element

Post by Support Team » Fri May 25, 2012 3:52 pm

Hi,

Did you try all the things Peter mentioned in his postings?
Do you have administrative privileges, is the UAC turned off on both machines and please also check if the full/extended version of the .Net 4.0 Framework is installed?
which resides on a shared drive - so same app.config
This can cause security issues, therefore please copy all the files to the hard disk as mentioned on the following page at Reason #2: General Troubleshooting.

Regards,
Markus
Ranorex Support Team