Forum Discussion
In automation we run previously identified UI objects in a given order.
So that manual repetitive work are assigned to a machine.
If those objects are "Brand new", TC do not have a capacity to identify.
But if this new object has particulate pre-determined unique properties,
you can program with wild cards, loops and conditions to handle those.
If you can elaborate more we may able to help
- tristaanogre8 years agoEsteemed Contributor
You might want to also look into Find and FindChild methods. Supposedly, you know what the object is that you are adding (caption, text content, etc). So, taking the parent object, you could call the "FindChild" method, passing in the properties and property values. This method will return the object you want.
I would not recommend attempting to map any of these dynamically added objects. This is generally a rule of thumb that I apply. If objects/components etc are added on the fly and created within the application (like new rows in a table, new icons in a panel, etc), I use Find methods to interact with them.
Something else I would recommend is a "clean up" process at the end of your test run or a "reset" process at the beginning. Your application is going to get "full" of all these created items and objects each time you run the tests. Once you complete a test, if you're finished with an object, if you have the ability to, I would remove/delete the item so that future test runs will not be "polluted" by extraneous test artifacts. Alternatively, you could do a database restore or some other "reset" process before you test starts to get your application to a "baseline" state so that, when you start your tests, they always start with the same basic data.
- kcurteman8 years agoOccasional Contributor
Once the item is created, it needs to be added to a schedule. We do this by going to the schedule and clicking the Add button. A Dialog opens and in it is a table with 2 columns; one with checkboxes and one with the item names.
The list includes all items that are available but not added to the schedule (either because they are new or exist on a different schedule)
I need to find the checkbox in the first column that is next to the Cell with the newly created item's name.
- tristaanogre8 years agoEsteemed Contributor
Yup, definitely use a Find on the table itself. Once you find the cell with the created items name, you then go to the Cell with that same row and one column over and access the child object of the cell. We do something similar in our stuff.
function findRow(tableObject, stringSearch, searchColumn) { var cellFound = Utils.CreateStubObject(); if ((searchColumn == 999) || (searchColumn == undefined)) { cellFound = tableObject.FindChild('innerText', aqConvert.VarToStr(stringSearch) + '*', 0, true); } else { for (var i = 1; i < tableObject.RowCount; i ++) { if (aqString.Trim(tableObject.Cell(i, searchColumn).innerText) == aqString.Trim(aqConvert.VarToStr(stringSearch)) ) { cellFound = tableObject.Cell(i, searchColumn); break; } } } if (cellFound.Exists) { return cellFound.RowIndex; } else { throw Error ('Unable to find the cell with string ' + stringSearch); } }
Related Content
- 2 years ago
- 13 years ago
- 12 months ago
Recent Discussions
- 3 days ago
- 4 days ago