I have a page with an image. The image has a label so I can test it with selenium:
<img data-field="logo" id="logoPanel_logo" src="images/rawlogo.png" alt="JAWS">
I use Errai to replace the image with a GWT ImageResource
@Inject
@DataField
protected Image logo;
@PostConstruct
public void init() {
logo.setResource(AnalyticsConsoleBundle.INSTANCE.rawlogo());
}
But when I look at the resulting page there is no Id tag on the image element.
<img onload="this.__gwtLastUnhandledEvent="load";" src="http://localhost:8080/AnalyticsConsole/AnalyticsConsole/clear.cache.gif" style="width: 215px; height: 69px; background: url(data:image/png;base64,iVBOR ..... kJggg==) no-repeat 0px 0px;" border="0">
I'm trying to use selenium to verify that there is an image of the correct id. Is there a way to keep the id on the tag?
Thanks,
Michael
Hi Michael,
what about logo.getElement().setId("logoPanel_logo") in the init method? But I don't know about any general solution.