1 Reply Latest reply on Oct 26, 2012 3:50 AM by ibek

    How do I put an Id on an image?

    mdhirsch30345

      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=&quot;load&quot;;" 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