Forum Discussion

jmarkman's avatar
jmarkman
Occasional Contributor
6 years ago
Solved

Loop through a jquery grid?

My company has a desktop product that opens a web browser to allow the user to access an information-displaying feature embedded in a web page. Among the UI elements on the webpage exists a jquery grid. Now, there is an element name that differs between all of the rows, but the number of elements in that row can vary based on the data the user provides to our software. Is there a way within TestComplete that I can simply use the alias of the jquery grid and loop through it like this StackOverflow answer would?

  • cunderw's avatar
    cunderw
    6 years ago

    So looks like this isn't just a standard jquery table, but a jqxgrid. Loaded up a sample and am seeing the same results as you. You might talk to SmartBear's support to see if they know a way to get native table functions in Test Complete. But you could also as a work around use FindAllChildren. It looks like be default the jqxgrid has idStrs for reach row as row<X>jqxgrid. <X> being the row number. This should give you an array of all of the rows in the table. Then each column is a cel with a class name of jqx-grid-cel, so you could use FindAllChildren again to get each cel in the row. 

6 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    Does the table itself have the properties RowCount and Column count? I believe jquery grids are supported out of the box by test complete.

    • jmarkman's avatar
      jmarkman
      Occasional Contributor

      Sorry for the late response. It doesn't look like it; I only get a list of methods for Internet Explorer itself. Instead, I'm allowed to highlight each element of the grid with Object Spy as if it were its own static HTML element.

      • cunderw's avatar
        cunderw
        Community Hero

        Can you post screen shots of the main table properties in the object browser?