Ask a Question

How to identify objects with the same properties in a single pane

srikanth2801
Contributor

How to identify objects with the same properties in a single pane

hi,



we have a button contains the text  "..."  . In a single pane we have three buttons like this.



how can we differentiate between the 3 button's . almost all the properties are same for the 3 buttons except height.



can anybody show me an example of how to identify those objects.


3 REPLIES 3
AlexanderM
Staff


Hello,





Could you please specify what kind of application you are testing (a .Net application, a VCL application, etc.)?

What type of button is it: a standard button control shipped with the IDE or a third-party control? If it is a third-party control, let me know its name, vendor and version.





As an immediate solution, you can add the Height property to the buttons' identification properties. However, this solution will work until the buttons' Height property is changed.





BTW, consider asking the application developers to give the buttons unique names - this will greatly simplify your task.
-----

Alexander
Customer Care Manager
srikanth2801
Contributor

hi,

we are testing the java application.



in that application we have swing objects. buttons textfields like those. how can we differentiate between the buttons if we have the same kind of properties in a single pane.



thanks in advance.
AlexanderM
Staff



Hello Srikanth,






A solution depends on the structure of the tested application.


If the user interface of the application has already been created and you are sure that it won't be changed, you can use the AWTComponentIndex property to identify buttons. If the UI is being developed and it may change, index changing may cause the test failure.


To find a solution that might suit you, I need some additional information, namely, the branch of the application's object hierarchy where the container resides with buttons. Please create a snapshot of the container that owns all the buttons using the following steps:






1. Start the tested application and open the form that contains the "..." buttons. 


2. Open the Object Spy (click the "Display Object Spy" button of the Tools toolbar) and using the Finder Tool pick the container that owns all the buttons you need to differentiate.


3. Then find the location of this object in the tree displayed in the Object Browser panel. To do this, select Highlight in Object Tree from the context menu of the Object Spy window.


4. Make sure the needed object has been selected in the Objects Tree. To create a snapshot for the object, click the Save Object Snapshot button on the Save\Load Snapshots toolbar. If the Save\Load Snapshots toolbar is hidden, right-click somewhere within TestComplete's toolbar or menu area and select Save\Load Snapshots from the pop-up list. 


5. Clicking the Save Object Snapshot button will open the Save Object Snapshot dialog. Specify the name  of the snapshot file and enable the following saving options: All Properties, Fields, Save recursively. Click OK. Please note that saving may take some time (it depends on the number of objects being saved).


6. Pack the snapshot file and send it directly to Support.
-----

Alexander
Customer Care Manager
cancel
Showing results for 
Search instead for 
Did you mean: