cancel
Showing results for 
Search instead for 
Did you mean: 

Loop through a jquery grid?

SOLVED
Highlighted
Occasional Contributor

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Loop through a jquery grid?

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. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

6 REPLIES 6
Community Hero

Re: Loop through a jquery grid?

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


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Occasional Contributor

Re: Loop through a jquery grid?

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.

Community Hero

Re: Loop through a jquery grid?

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


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Occasional Contributor

Re: Loop through a jquery grid?

Will this do?

 

ApplicationFrameHost_2018-07-24_10-21-26.png

Community Hero

Re: Loop through a jquery grid?

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. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

Occasional Contributor

Re: Loop through a jquery grid?

Great, thanks! I got some discussion going internally and we're simply going to change what we verify on the web page itself, but this is good to know for the future since I doubt this is the last I'll see of this grid.