Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 171083

Summary: AGR Recorder does not distinguish between two controls on the same panel if they have the same text and type
Product: z_Archived Reporter: Joe Toomey <jptoomey>
Component: TPTPAssignee: DuWayne Morris <dmorris>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: jerome.gout, kendricw, paulslau, rohit.shetty, Sanchali.Kshirsagar, SluhayOlesia
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 170651, 207253    
Attachments:
Description Flags
Patch to NonTrivialWidgetResolver.java none

Description Joe Toomey CLA 2007-01-19 13:58:26 EST
Examples include the two "Browse..." buttons on the second page of the New TPTP JUnit
Test wizard, and the two "Add" buttons on the overview page of the Datapool editor.  In
each of these cases, the recorder records the same referenceId for both controls, and
playback is incorrect/fails as a result.

(This not not in the AutoGUIRunner, but I
didn't see a more appropriate component.)
Comment 1 amehrega CLA 2007-01-19 16:26:17 EST
I can reproduce this with the datapool editor but I can't have it reproduced with the browse button of the JUnit editor.

I'm setting the priority to P1 and the severity to major.
Liz, please take a look at it.
Comment 2 Paul Slauenwhite CLA 2007-01-26 08:20:03 EST
Please provide an estimated sizing for this defect.
Comment 3 Paul Slauenwhite CLA 2007-01-26 08:45:11 EST
Will be included in the 4.4 plan.  

Please target to a 4.4 iteration.
Comment 4 Liz Dancy CLA 2007-03-14 16:11:10 EDT
Updating target to 4.4i3 as 4.4i2 ends 03/16/07.
Comment 5 Paul Slauenwhite CLA 2007-04-25 10:45:00 EDT
This is also an issue with the Logical and Resource actions on the Test Navigator toolbar.  To work-around this issue, set the ID of the action to the text label so it can be distinguished from the other action(s).
Comment 6 Paul Slauenwhite CLA 2007-05-18 16:18:40 EDT
This defect is a candidate for deferral from the 4.4 release.  If the originator has opposition, please provide an argument against this deferral.
Comment 7 Paul Slauenwhite CLA 2007-05-28 15:09:26 EDT
Assigning to i4 since i3 is complete but this defect belongs to a block of in-plan 4.4 defects that are candidates for deferral.
Comment 8 Joe Toomey CLA 2007-06-18 10:35:18 EDT
Approved for deferral from 4.4 by PMC.  Retarget to 4.5.
Comment 9 Paul Slauenwhite CLA 2007-08-20 08:32:05 EDT
Reassigning to Project Lead until new Component Lead is assigned.
Comment 10 Paul Slauenwhite CLA 2007-11-07 06:32:51 EST
Bulk update of the target field to reflect the change in iteration numbers.
Comment 11 DuWayne Morris CLA 2007-11-26 16:30:47 EST
*** Bug 210939 has been marked as a duplicate of this bug. ***
Comment 12 DuWayne Morris CLA 2007-12-11 11:17:45 EST
Changing target to 4.5i5.  I have a solution for the case where the button labels are in the same composite child list.  The general case I didn't finish yet is where the buttons with the same label are in separate composites that are part of a bigger composite (such as the Datapool editor) where I don't want to break other cases by using nailing it without climbing the object trees properly to verify that duplicates exist and identifying the proper object for playback.

This will be top priority as soon as the i4 test pass and automation work is completed.
Comment 13 DuWayne Morris CLA 2007-12-19 16:53:14 EST
Updated hours worked on this defect.  Additional time spent to become familiar with the AGR code is not included.  This code is mostly new to me.

As a result of a discussion with Paul regarding the fix for this defect, it was determined that the following would be a reasonable approach:

1.  For those buttons that are siblings in the child list with the same label, there will be a change in weighting to favor the ID of the correct button.  For some unkown reason today I am unable to reproduce this problem with the button ID weighting unchanged.  However, I had previously seen this issue for both project import and the JUnit test wizard on one of the builds last week.  So, I think it is worth increasing the weighting.

The weighting before changes was as follows in NonTrivialObjectResolver.java:
		new Object[] {text, "0.3"},
		new Object[] {hoverText, "0.3"},
		new Object[] {String.valueOf(children.length), "0.3"},
		new Object[] {size, "0.2"},
		new Object[] {location, "0.1"},
		new Object[] {String.valueOf(buttonInx), "0.2"},

One part of this that seems a bit odd is the relatively heavy weighting of the children.length at 0.3.  So, ONLY in the case where a button is selected by the user and there is more than one button with the same label in the same child list that appears BEFORE the selected button, I am changing the weighting of the button index to 0.4 and children.length to .1.  If this causes problems, we can revert to the code before the change.  Also, as Paul pointed out, all of these problems are with buttons that have no hover text.  It is suggested that tool tips should exist in the code for these buttons and it is speculated that tool tips would help significantly in identifying the widget with existing AGR code.

2.  For the datapool editor, the issue is that there are buttons with duplicate labels under separate composite parents.  Thus, the above modification has no effect, since the buttons are being processed by a different resolver and would not be detected since they are not siblings under the same composite object.  What is proposed in cases such as this one is that the owner of the code should provide hover text for the button.  It was agreed in our call that a separate defect would be filed against the datapool editor to provide a tool tip for these buttons to allow automated testing.
Comment 14 DuWayne Morris CLA 2007-12-19 16:55:00 EST
Created attachment 85610 [details]
Patch to NonTrivialWidgetResolver.java

Adding patch for changes made.
Comment 15 DuWayne Morris CLA 2007-12-19 16:56:07 EST
Change delivered to CVS, marking as fixed.
Comment 16 Paul Slauenwhite CLA 2008-01-02 11:56:18 EST
(In reply to comment #13)

> 2.  For the datapool editor, the issue is that there are buttons with duplicate
> labels under separate composite parents.  Thus, the above modification has no
> effect, since the buttons are being processed by a different resolver and would
> not be detected since they are not siblings under the same composite object. 
> What is proposed in cases such as this one is that the owner of the code should
> provide hover text for the button.  It was agreed in our call that a separate
> defect would be filed against the datapool editor to provide a tool tip for
> these buttons to allow automated testing.

Thanks Duwayne.  These changes to the datapool editor can be done under defect https://bugs.eclipse.org/bugs/show_bug.cgi?id=170651. 

Comment 17 DuWayne Morris CLA 2008-06-20 14:52:47 EDT
Verfied in 4.5i8.
Comment 18 DuWayne Morris CLA 2008-06-20 14:53:04 EDT
Closing.