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 <tristan.slomin...@gmail.com> > 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 google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> > . > 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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.