Announcement

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

    Test TreeGrid in Selenium

    Hi, I'd like to ask whether it is possible to write in scLocator the row name, something like this doesn't work :
    scLocator=//TreeGrid[ID="ideItemTreeGrid"]/body/row[itemName="new folder"]/col[fieldName=nodeTitle||0].

    Can I somehow point not the row number, but it's content?

    #2
    The solution is
    scLocator=//TreeGrid[ID="ideItemTreeGrid"]/body/row[name=Test Folder]/col[fieldName=nodeTitle||0]

    Comment


      #3
      Is there any way to select node in TreeGrid, in the way onSelection event to be called? Can you help me, please?

      Comment


        #4
        Hi ,

        How can get the number of rows for tree grid ?? in Selenium

        I would like to click on all rows of tree grid to test the values of different fields
        i would like to do that using for loop but i cant do it if i cant have the tree grid
        rows count ?????

        Can i click on all tree value with out having the tree row count ???
        How can i do it ?

        Please any Help ....

        Comment


          #5
          Maybe I can provide a dirty solution:

          You can loop endlessly through all rows and when you encounter a row that is not present (timeout when trying to find it) you break the loop and know the number of rows.

          This works if all your rows are inside the DOM which may not be the case for grids that are large and must be scrolled, because they may be dynamically loaded into and out of the DOM.

          Comment


            #6
            That could work, but the simple way is just to evaluate a JavaScript expression: treeGridId.getTotalRows().

            Comment


              #7
              Isomorphic, are you saying it's possible to call treeGridId.getTotalRows() via selenium?

              For example, I have a grid where I have an example header locator:
              scLocator=//VLayout[ID="ClientPane_Center"]/member[Class=HLayout||index=11||length=14||classIndex=11||classLength=14]/member[Class=VLayout||index=0||length=2||classIndex=0||classLength=1]/member[Class=VLayout||index=0||length=4||classIndex=0||classLength=2]/member[Class=TreeGrid||index=1||length=2||classIndex=0||classLength=1||roleIndex=0||roleLength=1||scRole=tree]/header/headerButton[fieldName=synthkey3]/

              And an example cell locator in the first row for the same column:
              scLocator=//VLayout[ID="ClientPane_Center"]/member[Class=HLayout||index=11||length=14||classIndex=11||classLength=14]/member[Class=VLayout||index=0||length=2||classIndex=0||classLength=1]/member[Class=VLayout||index=0||length=4||classIndex=0||classLength=2]/member[Class=TreeGrid||index=1||length=2||classIndex=0||classLength=1||roleIndex=0||roleLength=1||scRole=tree]/body/row[synthkey0=5815428||synthkey3=Pending||0]/col[fieldName=synthkey3||3]

              I would like to know how I can get the number of rows and columns in the grid so I can iterate through it and read the data out of the grid.

              Comment

              Working...
              X