GWT builds that specific use case.

Use the widget.ensureDebugId() to set the ids.

In dev and test, inherit the debug module. Put the following line in your
module xml
<inherits name='com.google.gwt.user.Debug'/>

When compiling for production, remove the debug module. That way, the test
code will be removed.

To simplify your scripts, create a new module MyModuleTest.gwt.xml which
inherits from MyModule.gwt.xml, and add the extra inherits line. Then
compile the appropriate module based on the environment.

--Sri


2009/11/19 Tristan <[email protected]>

> Here's what I would like to do:
>
> Selenium tests are easiest to run if each element has a unique id. I
> would like to be able to do something along the lines of:
>
> if Compiler style is Pretty.. include the line:
>
>  widget.setElementId("easy-to-locate-id-for-tests")
>
> but if I set the Compiler to Obfuscated (i.e. production), I don't
> want that extra test code in there.
>
> Is this possible? If so, how?
>
> -Tristan
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=.


Reply via email to