Announcement

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

    Selenium locator for the selected row in a ListGrid

    Hello, we may be missing something but we have a tough time to figure out if and how we can write a selenium locator to get the values of a selected row. Any other ideas would also be helpful

    For example

    //ListGrid[ID="<someID>"]/body/row[0]/col[fieldName=<someField>]

    Works well to get the value of somefield in the first row of that ListGrid

    We tried stuff like

    //ListGrid[ID="<someID>"]/body/row[activeRow=true]/col[fieldName=<someField>]
    //ListGrid[ID="<someID>"]/body/row[selected=true]/col[fieldName=<someField>]

    Without success

    Is there something that could help us here?

    #2
    Are you writing a Selenium script or using our SmartClientWebDriver APIs from Java?

    Comment


      #3
      Here we are using


      isc.AutoTest.getElement("//ListGrid[ID="<someID>"]/body/row[0]/col[fieldName=<someField>]");

      Comment


        #4
        You're running JavaScript code to get the DOM element from a locator? What's the use case? Where is the locator coming from? Is the JS code part of your app?

        Comment


          #5
          Hello, Sorry for the confusion. We are running SmartClientWebDriver

          Comment


            #6
            There's a way to write a locator that will return whether the targeted element is selected (when passed to SmartClientWebDriver.getValue()), but there's not currently a way to write a locator to the selected row of a grid. You'd have to do it in JavaScript using SmartClientWebDriver.executeScript().

            If you'd consider Feature Sponsorship, we may be able to add some new locator syntax to support what you need.

            Comment


              #7
              Thank you

              Comment

              Working...
              X