This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Many test tools/frameworks access the position of the text field in order to populate it during ui testing. The expected behavior is that they are added to the layout manager in the same configuration as they are shown on the screen. The JSP text field appears to be first, but is actually in position 1 according to the layout. The line number field appears to be second, but is actually in position 0 according to the layout. This oddness makes writing test cases more difficult.
If this really bothers you creating a patch may be the best way as we don't have resources to fix such minor issues. If the time spent with finding working way is comparable to writing patch please do the latter.
fixed in the NB34
Verified with Netbeans dev build 030227.
This is still broken. I just checked the code at <http://www.netbeans.org/source/browse/web/jspdebug/src/org/netbeans/modules/web/debug/JspBreakpointPanel.java?rev=1.6&content-type=text/x-cvsweb-markup> and I still see that tfLineNumber is added to the panel before cboxClass. I also tried running my test case without the workaround and it still fails.
What you describe is not a defect. So if it is a *real* problem try to submit a patch.
Okay, I'm submitting a patch.
Created attachment 9694 [details] patch created against 35 branch
Wouldn't it make much more sense to use components' name property to find them for tests? If the test relies on the order in which components are added, this seems like an singularly easy way to make brittle, often-broken tests. We could create a naming convention for components and raise awareness that for UI tests it is important to give GUI components names. I for one, would not mind at all if someone surreptitiously added a name property to some GUI form of mine so they could write a good test - they wouldn't even need to ask my permission - just go check it in. It strikes me as well worth it - a persistent string name is infinitely more reliable than depending on consistent ordering.
See also: http://www.netbeans.org/issues/show_bug.cgi?id=1289 http://www.netbeans.org/servlets/ReadMsg?msgId=494253&listName=nbui
Hello? You asked for a patch and I submitted one almost 9 months ago. Can someone review and apply it please?
Martin, can you please look at this and apply Rochelle's patch? Thanks.
I believe it's fixed now. Please reopen if I missed something.
Verified.