BackColor Attribute?
Re: BackColor Attribute?
Yes thankyou! this works. Although your second line needs to have <Ranorex.Control> instead of just <Control>
-
- Posts: 1
- Joined: Mon Jun 09, 2014 4:10 pm
how do I get tabpage (flex Object) Color ?
Hi,
I have Tabpage object ,it has Grey color I need to get color of the tabpage ,its type of flex object.
I tried following code for tabpage object but it didn't worked.
Text text = "/form[@controlname='frmMain']/container/container/element/container/container/text[@controlname='txtDetails']";
Color color = (Color) text.As<Control>().GetPropertyValue("BackColor");
Text text = "/form[@controlname='frmMain']/container/container/element/container/container/text[@controlname='txtDetails']";
Color color = (Color) text.As<Control>().GetPropertyValue("BackColor");
its throwing exception "Object reference not set to an instance of an object".
Plz help me....
Regards
Amruta
I have Tabpage object ,it has Grey color I need to get color of the tabpage ,its type of flex object.
I tried following code for tabpage object but it didn't worked.
Text text = "/form[@controlname='frmMain']/container/container/element/container/container/text[@controlname='txtDetails']";
Color color = (Color) text.As<Control>().GetPropertyValue("BackColor");
Text text = "/form[@controlname='frmMain']/container/container/element/container/container/text[@controlname='txtDetails']";
Color color = (Color) text.As<Control>().GetPropertyValue("BackColor");
its throwing exception "Object reference not set to an instance of an object".
Plz help me....
Regards
Amruta
-
- Posts: 6
- Joined: Wed May 27, 2015 9:22 am
Re: BackColor Attribute?
I am getting the same "Object reference not set to an instance of an object." error...
Anyone resolves this?
Thanks!
Winnie
Anyone resolves this?
Thanks!
Winnie
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: BackColor Attribute?
Hi Winnie,
May I ask you to post a Ranorex snapshot file of the element you want to get the color from?
The following link will show you how to generate a snapshot file: Creating Ranorex Snapshot Files.
Do you use the exact same code or another one?
Thanks,
Markus
May I ask you to post a Ranorex snapshot file of the element you want to get the color from?
The following link will show you how to generate a snapshot file: Creating Ranorex Snapshot Files.
Do you use the exact same code or another one?
Thanks,
Markus