Inconsistent Id Generated on HTML Component [message #71991] |
Mon, 28 January 2008 23:50  |
Eclipse User |
|
|
|
Hi all,
The 1st time when running RAP with UI Test parameter enabled I notice that
the id generated starts from 'w3', but the next run it starts from 'w2',
this make it hard to write consistent components identification by their
Id's. Is there any reason why the Id does not consistently starts from
'w1' ?
Best Regards,
Setya
|
|
|
Re: Inconsistent Id Generated on HTML Component [message #72156 is a reply to message #71991] |
Tue, 29 January 2008 18:27   |
Eclipse User |
|
|
|
Originally posted by: rsternberg.innoopract.com
Hi Setya,
Setya wrote:
> The 1st time when running RAP with UI Test parameter enabled I notice that
> the id generated starts from 'w3', but the next run it starts from 'w2',
> this make it hard to write consistent components identification by their
> Id's. Is there any reason why the Id does not consistently starts from
> 'w1' ?
Yes there is, "w1" is reserved for the Display, "w2" is used by a label for
the text size determination, which does not always run (since measured text
sizes are cached).
However, you should never rely on these ids, rather assign unique ids of
your own to the tested widgets like this:
widget.setData( WidgetUtil.CUSTOM_WIDGET_ID, "myTestId-1" );
See Javadoc on WidgetUtil.CUSTOM_WIDGET_ID and the discussion on
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204859
Best Regards, Ralf
|
|
|
Re: Inconsistent Id Generated on HTML Component [message #72188 is a reply to message #72156] |
Tue, 29 January 2008 23:07  |
Eclipse User |
|
|
|
Ralf,
> Yes there is, "w1" is reserved for the Display, "w2" is used by a label for
> the text size determination, which does not always run (since measured text
> sizes are cached).
Thanks for your clarification.
> However, you should never rely on these ids, rather assign unique ids of
> your own to the tested widgets like this:
> widget.setData( WidgetUtil.CUSTOM_WIDGET_ID, "myTestId-1" );
I'm aware of the capability to assign custom unique id, but as I
understand I can only do this on components that I myself render.
What if I need to click menus of coolbar buttons, asserting that certain
views/editors open, shouldn't I rely on this these ids ? Or is there any
way to assign custom id to these components ?
Best Regards,
Setya
|
|
|
Powered by
FUDForum. Page generated in 0.06039 seconds