1

I am not able to get the Id property for flex components in my flex application(swf file) using Test Object Inspector in Rft Tool.

How can i get them?

Eonasdan
  • 7,563
  • 8
  • 55
  • 82
Abhishek
  • 338
  • 5
  • 20

2 Answers2

1

You can't. Flex mxml component ids are only used as a hash within the containing parent. They're only used for referencing objects and are discarded at compile time.

J_A_X
  • 12,857
  • 1
  • 25
  • 31
  • Is there any other way to get the id's ? – Abhishek Sep 26 '11 at 05:15
  • What are you trying to accomplish exactly? – J_A_X Sep 26 '11 at 05:27
  • I have one flex application(swf file) having some basic flex components. When i use Test Object Inspector to list various properties of any component ,it doesnt give any value in Id property for that component. How can i get id's? – Abhishek Sep 26 '11 at 05:52
  • What's Test Object Inspector? There is no 'id' property on components. There is a 'name' property you can use if you want to differentiate between components, but that's it. – J_A_X Sep 26 '11 at 05:58
  • Test Object Inspector(TOI) is a part of RFT Tool to inspect the properties of components.. Id property is present for components(textfield,label) in my flex application.. TOI is not showing id for flex components in my application – Abhishek Sep 26 '11 at 06:09
  • Again, *there is no id property on UIComponents*. There is a 'fake' property added only to mxml components for relating things together in the same file (for easier development), but if you look at the API, you'll see that none of these components actually have an id property. – J_A_X Sep 26 '11 at 07:07
  • There is Id property present in my flex application for flex components – Abhishek Sep 26 '11 at 09:24
0

If you have an id property for your flex component then there are a couple of ways to find out the id property of your desired control.

Make sure you have embeded your .swf file inside an html wrapper(as suggetsed by RFT) and displaying it in an enabled IE browser.

Hover over the component, say a button(and you should see automation name as well as id value).

Else you can do a simple script call to get the id of desired component:

System.out.println(desired_object().getProperty(".id"));
Robert
  • 5,278
  • 43
  • 65
  • 115
Archiekins
  • 30
  • 5