Announcement

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

    Unable to do automated click elements with HTML in locators

    Since recently (I believe it occurs since our switch to SmarGWT 4.0), we are experiencing a lot of problems with automated testing. It turns out that selenium cannot click on elements where their locator includes HTML code.

    For instance, a Tab, where we do setTitle as follows:
    Code:
    String formattedTitle = "<span>" + Canvas.imgHTML(icon) + tabTitlePrefix + tabTitleSROPrefix + " " + tabTitleText + "</span>";
    		setTitle(formattedTitle);
    This works fine, and the scLocator for the close button on the tab becomes this:
    Code:
    //TabSet[ID="sid_workspace"]/tab[title=<span> Contract 600044<%24fs%24span>||ID=tab_2]/icon
    Then, since we know the ID, we have always removed "title" from the locator to perform the click. Sadly, the below locator that used to work, doesn't anymore.

    Code:
    //TabSet[ID="sid_workspace"]/tab[ID=tab_2]/icon
    Can this be fixed to make it work like in SmartGWT 3 ?

    Note that I tested my case with a very recent build:
    SmartClient Version: v9.0p_2013-09-30/Pro Deployment (built 2013-09-30)

    #2
    If you have explicitly assigned the ID "tab_2" to the tab, that locator will work.

    If not, then the fact that the locator worked at all in 3.0 was just chance - it's using an auto-assigned ID that can have a different value with a different instantiation order. You should replace this locator with the locator that is now returned for the tab.

    Comment


      #3
      Hi,

      We are indeed setting the ID explicitly, following your reasoning that should mean that is should work - sadly it does not.

      We see no reason why this could be failing, the locator is correct and when we look at the ID's of the components using dev console they exist too.

      Please indicate how this can be investigated further, the outage of our automated tests is causing a serious delay on our development process.

      We are quite concerned that this simply stopped working after updating to a new release.

      thanks

      Comment


        #4
        We've checked SC 9.0p and specifically the online showcase sample at http://www.smartclient.com/#tabsOrientation, and if you add IDs "fred" and "barney" respectively to the two tabs of the TabSet with ID "topTabSet" then the following locators work fine:

        Code:
        scLocator=//TabSet[ID="topTabSet"]/tab[ID=fred]/icon
        scLocator=//TabSet[ID="topTabSet"]/tab[ID=barney]/icon
        I can click on said locators (in Selenium IDE) and toggle between the two tabs. So, we see no problem here, and you'll need to give us a specific test case that reproduces the issue.

        Comment

        Working...
        X