I'm trying to automate the testing for a Silverlight application but I'm a bit stuck.
There's a DataGrid that needs a new entry.
First, I press a button which adds a new row to the DataGrid.
Then I try to locate the first new cell in this row and enter a value but it doesn't always find this new cell.
Any idea on how to fix this or to approach this from a different angle?
4 Answers, 1 is accepted
It's hard to say why your test randomly fails to find the DataGrid cell without more information. See here on what to provide so we can continue troubleshooting. If you regard that information as sensitive, you can attach it to a support ticket which is confidential, unlike this forum.
If you are getting "Unable to locate element" error, check this article for information on how to troubleshoot it.
If executing via Quick Execute, you can also increase the global Wait on elements timeout setting in Quick Execution Options. The bottom of this page shows where to find that setting. If it's a Test List, you can do the same from the Test List Settings. This will extend the built-in wait for each action step.
the Telerik team
Test Studio Trainings
I have a similar problem using a data-driven test to input multiple rows of a Silverlight datagrid.
I recorded the test using the first row of the datagrid. I have 26 rows of data to input, which should result in 26 "readings" in the resulting datagrid. The problem is the reference to the cell name.
I recorded the entry into the first row, then linked my typed input to fields in the dataset. The detected names of the datagrid elements are "Item2textbox", "Item3textbox", and so on and so forth. A fully populated grid would generate names like "Item87textbox" etc..etc..
Do I have to create named elements for every cell of every row in the final datagrid, and then use those same names from the spreadsheet to target the correctly named cell? That seems like a VERY high maintenance way to do it. Ideally, when I click on "Add reading" and a new row is created in the data grid, there would be some way to tell the test to populate that new row with the next data record in the spreadsheet.
Using newest version of test studio (2013.1.806.0)
I want to use a data point to identify the row index, start with the first celland enter four cells worh of data. The next test step would be to click on "Add Reading" and I would cycle through the data, adding rows and entering data until the data is exhasted.
How do I use the data $(rowindex) to find a specific row to start entering data, and make sure the auto-numbered cell numbers (captured during the record process) are totally ignored. I do NOT want to record a test that has to repeat the entry process 25 times just because the cells are a specific number.
The grid is a standard Microsoft Silverlight datagrid control. I pay for support so I guess I'll also enter a support ticket.
I want to use a data point to identify the row index...
In a case like this one approach is to use Data Driven find expressions. Have the data in your data source define the find expression that Test Studio will use to locate the target element. You can also include the data to be entered in each cell in the data source.
...each new row comes with some data already populated. That data needs to be deleted...
Test Studio is supposed to automatically delete anything that happens to be in there. To really guarantee it you can uncheck "SimulateRealUser" in the Set Text step property - see attached screen shot.