This is a migrated thread and some comments may be shown as answers.

Entering new row into DataGrid

4 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kristof
Top achievements
Rank 1
Kristof asked on 18 Apr 2012, 07:38 AM
Hello,

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?

Kind regards,
Kristof.

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 21 Apr 2012, 02:44 PM
Hello Kristof,

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.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Chris
Top achievements
Rank 1
answered on 30 Aug 2013, 03:50 PM
Hello,
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.

thanks

Using newest version of test studio (2013.1.806.0)
0
Chris
Top achievements
Rank 1
answered on 03 Sep 2013, 09:34 PM
Update:  I have added an index row into my data and made the WAIT command look for the dynamic rowindex (always starts at "0").  But I really want to FIND the row that matches the index, and then start entering four cells worth of data associated with that rowindex. 

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.
0
Cody
Telerik team
answered on 04 Sep 2013, 07:09 PM
Hi Chris,

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.

Regards,
Cody
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Kristof
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Chris
Top achievements
Rank 1
Cody
Telerik team
Share this question
or