Page 1 of 1

Controls has dynamic elements which are getting repainted

Posted: Fri Dec 28, 2012 12:11 pm
by harendra
Hi,

i am working on an automation piece right now using Ranorex 3.3.0. wherein I have a control which has elements.

everytime when I close the form and re-open it, the control is static however the elements int he control get repainted depending upon the layout you choose.

When I use the spy to check on the elements in the control, every time I get a new element number, Is there a way to identify these elements. When I look at the properties of the element, the control ID itself is changing.

Please help.

regards
Harendra

Re: Controls has dynamic elements which are getting repainted

Posted: Fri Dec 28, 2012 1:29 pm
by Support Team
Hi,

Is there another attribute which uniquely identifies the elements?
In order to analyze the issue in detail we would need a Ranorex snapshot file, could you post or send ([email protected]) us two snapshots of your application (of different layouts)?
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.

Regards,
Markus

Re: Controls has dynamic elements which are getting repainted

Posted: Fri Dec 28, 2012 3:51 pm
by harendra
Hi Markus,

I have sent you the snapshot. Please let me know in case you have problems downloading the attachments. Actually just one concern all the cells represented are bitmaps, represented by System.Drawing.bitmap.

regards
Harendra

Re: Controls has dynamic elements which are getting repainted

Posted: Fri Dec 28, 2012 4:11 pm
by Support Team
Hi Harendra,

Thanks for the snapshots, they helped a lot!
Do you have already tried to add the whole process or the specific classes to the GDI capture list as described in the following blog?
Testing of Legacy Applications
If not please give it a try and please let us know if that helped.

Thanks,
Markus

Re: Controls has dynamic elements which are getting repainted

Posted: Fri Dec 28, 2012 5:17 pm
by harendra
Just sent a separate e-mail. please advise.

regards
Harendra

Re: Controls has dynamic elements which are getting repainted

Posted: Mon Dec 31, 2012 2:53 pm
by Support Team
Hello Harendra,

In order to analyze the issue we need more information or access to your application. I sent a few questions to you via email.
Thank you.

Regards,
Bernhard

Re: Controls has dynamic elements which are getting repainted

Posted: Wed Jan 02, 2013 9:59 am
by harendra
Hi,

Is there some way of enabling the plugin "Add Class or Process to GDI Capture List", programmatically, I mean through the code?

I require to track the raw elements though code.

Regards
Harendra

Re: Controls has dynamic elements which are getting repainted

Posted: Wed Jan 02, 2013 11:04 am
by Support Team
Hello Harendra,

Unfortunately, it is not possible to add a class or a process to the GDI Capture List via code.
I am afraid that I didn’t catch your issue.
If you want to get attributes of an RawText element using the RxPth you can try to use the following code.
RawText element = @"/form[@title='YourApp']/PathToYourElement/rawtext[@rawtext='text']";
E.g. RawTextValue arrtibute:
Report.Info(element.RawTextValue);
If this will not help please explain your issue in more detail in order to give you a workaround.

Regards,
Bernhard

Re: Controls has dynamic elements which are getting repainted

Posted: Wed Jan 02, 2013 11:21 am
by harendra
hi,

Issue is here: When you open a "View spy" then Raw Text Ranorex elements are not shown. Only after adding this manually, I started seeing the Ranorex raw text elements.

So now the question is when I am coding this, can I still get the Ranorex Rawtext elements without adding a GDI class, or will there be a situation when the Ranorex raw text elements don't exist during the run time.

regards
harendra

Re: Controls has dynamic elements which are getting repainted

Posted: Wed Jan 02, 2013 3:10 pm
by Support Team
Hello Harendra,

Did you add the process name to the GDI capture list? If you do so all RawText elements should be shown if you open Spy.
It should be not necessary to add the classes to the GDI capture list every time you open Ranorex.
If you take a look into the 'GDI Capture Settings' you should see all classes and processes which were added to the list. The settings can be found if you open the main 'Settings' dialog within Ranorex Spy and click the 'GDI Capture Settings' button.

Regards,
Bernhard

Re: Controls has dynamic elements which are getting repainted

Posted: Wed Jan 02, 2013 3:58 pm
by harendra
Hi,

No ,I think I have misled you.

Actually, for making a GDI capture list plugin to work on one machine, I can enable the plugin and then write some code.

But if you port the same code having ranorex but GDI plugin setting not yet made, would the rawtext elements be still visible or again I have to manually enable the plugin?

Regards
Harendra

Re: Controls has dynamic elements which are getting repainted

Posted: Thu Jan 03, 2013 12:01 pm
by harendra
Hi,

Any updates, will the plugin setting be enabled automatically if I port the solution from one machine to another.

Regards
Harendra

Re: Controls has dynamic elements which are getting repainted

Posted: Thu Jan 03, 2013 2:16 pm
by Support Team
Hello Harendra,

Ah, now I think I understand what you want to do.
If you want to use your solution on another computer you have to transfer the GDI capture settings to the new machine.
To do so you can copy the entry within the GDI Capture list from the old machine and add the entries to the list on the new machine.
gdi-capture-list-7.jpg
Regards,
Bernhard