How to handle dynamic elements in Dev Express Grid using Robot Framework?

Hi Barry,

I’ve found with applications like this where all the id’s are system generated that you need to find something else on the page as a reference point and leverage that reference point.

I found a publicly available DevExpress table, so I’ll use this as a reference as you didn’t provide a link to your app, hopefully this is similar enough.


As you can see the data structure appears similar.

The first thing I notices is the data and column headings are in different tables

So you’ll want to know how to identify them, in this example Class “dx-datagrid-headers” for the heading row and “dx-datagrid-rowsview” for the data rows

So first you want to identify the column you need, in the example above if I want the “Last Name” column I could use an xpath like this //div[contains(@class, "dx-datagrid-headers")]//td[div[text()="Last Name"]] to give me the td (table data cell) that contains "Last Name), I can then get the aria-colindex attribute to get the column number

In your case, it looks like most of the column headings are missing, so you’ll probably want to get the “EXP” column, and then subtract a few (5?) and hopefully this will reliably get you the right column number, save this to a variable like ${inputcol}

Again you might also want the “Seq” column?

Next you need the row number, I gather the value “19744S” (1) in your screen shot is a value you already know? so to find it’s row number, I’ll use the example of finding the row number of the position “IT Manager” from the example table above

Using xpath //div[contains(@class, "dx-datagrid-headers")]//td[div[text()="Position"]] and the the aria-colindex attribute, I know the Position column is column 5
So then I can use xpath //div[contains(@class, "dx-datagrid-rowsview")]//tr[td[@aria-colindex=5 and text()="IT Manager"]] to get the tr (table row) that contains the text “IT Manager” in column 5, with this I can use the attribute aria-rowindex to get the row number, in your case I guess you’ll be finding the row that contains “19744S” in column 3?

Once you have that row number, you can subtract 1? to get the row you need to enter data into (2), save this calculate row number to something like ${inputrow}

Now it’s just a matter of constructin the xpath to your input field, something like //div[contains(@class, "dx-datagrid-rowsview")]//tr[@aria-rowindex=${inputrow}]/td[@aria-colindex=${inputcol}]/input I’d guess.

Hopefully that helps,

Dave.