Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGwt 4.1 setId of element causes style to change



    I have been tasked with assigning id's to various elements in one of our applications. these id's would then be used by selenium in another app to test the UI using the . We are using SmartGWT 4.1 currently for the UI in that app.

    When I assign the element an id I notice that the style of the element gets corrupted so the button for example gets moved and I also cannot see the id assigned when I inspect element. These buttons are created in the constructor of a parent Vlayout

    I am testing this in Chrome currently. Can anyone advise as to why this is happening. I am following what I thought was best practice for assigning id's at a DOM level, but may be missing something. Please see example below for code:
    IButton testButton = new IButton("Button"); testButton.setWidth(150); testButton.getElement().setId("buttonId"); Just an fyi I have already reviewed the AutomatedTesting documentation and still cannot seem to fix this situation. I have also tried things like setting the element name or classname which can also be used by selenium but am seeing the same issues with the style getting disrupted on the element.
    Thanks for any help!

    #2
    If you've reviewed the Automated Testing documentation then you should know that you use scLocators with SmartGWT, not DOM-level IDs.

    What you're doing here would overwrite the generated DOM IDs that the framework assigns, breaking everything, since suddenly our components cannot find the DOM they generated. This strategy is 100% a dead end.

    Comment


      #3
      Thank you for the fast response, would it be possible for you to provide an example of how to set an scLocator in smartgwt or point me to some documentation on how to assign an scLocator in my java code? I am just looking for clarification on how to set this.

      Thanks

      Comment


        #4
        You need a reread of the Automated Testing overview. You don't "set" scLocators, you get them from components.

        Comment


          #5
          These are the key topics to review:

          Comment

          Working...
          X