jQuery UI Widgets › Forums › Grid › Integrating Selenium automation with jqxGrids
This topic contains 5 replies, has 3 voices, and was last updated by Derek Broughton 6 years, 7 months ago.
-
Author
-
Hey guys, I’m trying to set up testing automation using Selenium (With Python) on a web-page using jqxGrids. I’ve been trying to figure out how to direct Selenium to specific cells within the grid. The issue I’m having is that jqxGrid randomizes the ids every time the page loads. I could use some long and complicated XPaths to locate the cells I’m looking for, but part of the problem here is that there are over a dozen jqxGrids on the page that all have similar, if not identical structures.
Does anyone have any suggestions or solutions to help with this?
Hi Padawan,
Using IDs would not be possible. Implement the cellclassname callback function so you may have unique Class for each cell with the proper implementation and then use the Cells class for selection in Selenium.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Thanks for getting back to me so quickly. Could you tell me more about the function you’re referring to? I don’t see anything about cell classes in jqxGrid’s documentation.
Hi Padawan,
Demo: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridcellclass.htm?light
Best Regards,
Peter Stoev
jQWidgets Team
http://www.jqwidgets.com/I’m not well versed in JQuery, but what I’m seeing there doesn’t seem to do what I’m looking for.
I’m looking for a way to direct Selenium to Row X, Column Y and read the entry there. CellClassName appears to require the contents of the cell ahead of time.I know this is an old post, but since I’m looking for the same information, I thought I’d add my understanding of Peter’s response.
From his example, if you’d used:
var cellclass = function (row, columnfield, value) { return columnfield+'-'+row; }
you will get the classnames
UnitsInStock#0
toUnitsInStock#9
added on all of those cells, then you can have Selenium select those specific classes. GettingRow1Column2
is a little more complicated, but it’s just a lookup of thename
properties ofsource.datafields[]
-
AuthorPosts
You must be logged in to reply to this topic.