How to capture Layout Grid rows dynamically in ATS scripts

I have a listview which displays list of jobs, on clicking one job in this list next dataview listens and displays corresponding details of job. I am trying to capture this click on list view row but ATS recorder is not identifying this event. Is there any action in ATS that can be used to dynamically identify a list row, just like we have for data grid. If I explicitly give following – layoutGridSavedJobs index-1 textBox4, it works as expected. But my index# will vary everytime I run the script and hence need a way to dynamically look for row with my expected job#.
1 answers

Hi Shaivya,

This can be achieved by using three ATS actions:

First, you need to find the element that contains the job#. You can use one of the 'Find Element’ actions for that, of which I prefer the ‘Find Element by Sizzle’ action. (Sizzle is an extended JQuery library, which allows you to find anything on the page). This action uses a sizzle selector as required parameter. If your job# is in textBox4 that selector would look like this:


Now, if that job# is different for every time you run the test case, you can create the selector dynamically with a ‘Concatenate String’ action. For now, I'll assume you know how to do this. If not, let me know and I'll explain.

Second you can now use ‘Find Item/Row (by child element)’, with the element that you located in step 1 as parameter. This returns the row in the listView that contains that job# element.

Third, you can use the ‘Click/Doubleclick’ action, using the returned row as parameter.

Hope this helps you on your way. If not, please don’t hestitate to continue asking questions here or contact me directly by email.

With kind regards,
Joris van der Heijden
ATS Consultant @ Mansystems