Accessing Icon info of a Picture from Silverlight

Class library usage, coding and language questions.
User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Accessing Icon info of a Picture from Silverlight

Post by Aracknid » Mon Feb 06, 2012 5:57 pm

When I use Spy on a picture from Silverlight, Spy shows In General --> Role (picture) --> Icon

How do I access the info of this icon section. Specifically I'm looking at the Tag property.

If you provide code, VB please. :D

Thanks,

Aracknid

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

Re: Accessing Icon info of a Picture from Silverlight

Post by Support Team » Tue Feb 07, 2012 7:16 am

Hi,

the following code provides the attributes and the attribute values for a picture element.

Code: Select all

Dim pictureImage = repo.WebDocumentSilverlight_Toolkit_Samp.PictureImage
			For Each attribute As AttributeDescriptor In pictureImage.Element.Attributes
				Report.Info(Convert.ToString(attribute) & ": " & vbTab & Convert.ToString(pictureImage.Element.GetAttributeValue(attribute.ToString())) & vbLf)
			Next
If you are writing Tag property, what exactly do you mean with tag property.

Regards,
Martin
Ranorex Support Team

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Accessing Icon info of a Picture from Silverlight

Post by Aracknid » Tue Feb 07, 2012 3:53 pm

The reason I was hoping to get the Tag was because we are trying to figure out a way to pass the source file through Silverlight to Ranorex so I know what picture is what. You suggested we look into UIAutomation in another post (http://www.ranorex.com/forum/possible-t ... t2288.html), but that was not something warmly excepted by the development team.

This lead them to be willing to try other things... I was asked if I could read the Image Tag property, and I said maybe... There's a Tag property for icon visible in Spy tool...What ever they did on the dev side didn't seem to work, since I still saw nothing. Then they tried something called HelpText, and it showed up in Spy in the UIAutomation section... See picture, and scroll to bottom.
spy bmp.JPG
So now I need to figure out how to read the HelpText property of the Picture element's UIAutomation section. I managed to do it, but it seemed to be a lot of code and I had to add a bunch of references. Is there an easy way?

Aracknid
You do not have the required permissions to view the files attached to this post.

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Accessing Icon info of a Picture from Silverlight

Post by Aracknid » Tue Feb 07, 2012 7:46 pm

Please ignore my previous post above. I was not properly informed by the developer working on this. It turns out that he did use the UIAutomation class and he did stuff the HelpText property with the file name as per your suggestions in the other post.

Also, I figured out the easy way to read the UIAutomation values from the Ranorex element.

Aracknid.