Home › Forums › WinForms controls › Xceed Grid for WinForms › GUI Test Automation
-
AuthorPosts
-
#13566 |
Is anyone doing any Test Automation with the Grid control?
I’m trying to speed up the scripting as the process is laborious.
I’m using IBM Rational Functional Tester with Visual Studio.NETAt the moment the only way for the tool to find a control, in the grid, is for me to click in the area while I’m recording. I then have to use a WaitForExistence call to ensure the control is instantiated. (This is all good for performance but not for testing tools.)
I’ve also looked at the properties of the control to see if I can find out some more details.
As the test tool is able to build an object map of all represented objects ideally what I like to be able to do is get the grid to populate the controls without having to click on them. I can then find all the controls in one pass. I also can’t get to a control if it’s not enabled, so fields that are calculated cannot be read.
Any thoughts appreciated.
Carl
Imported from legacy forums. Posted by AutomatedQA (had 941 views)
What do you exactly mean by <i>find a control, in the grid</i>? Is it the CellEditor you’re talking about?
Imported from legacy forums. Posted by Tommy (had 186 views)
Sorry not used to the terminology.
I’ve read though the docs and yes I would say it is a CellEditor.
I was wondering if there was something in Accessibility that would enable the testing tool to get more information from the Cells?
Imported from legacy forums. Posted by AutomatedQA (had 448 views)
What information do you need from the Cells?
To enable a CellEditor for a specific cell, edit its contents and commit the change, do this:<code>cell.EnterEdit();
// do something with cell.CellEditor
cell.LeaveEdit(true);</code>Imported from legacy forums. Posted by Tommy (had 843 views)
I have no problem getting the information from the cell.
However it’s only instantiated when I click on the cell. So I have no way of programmatically finding the cells in the grid with the testing tool. As the tool can’t identify cells it won’t know where to click.
Imported from legacy forums. Posted by AutomatedQA (had 515 views)
To find the cells programmatically, you could loop over the DataRows, and for each DataRow, loop over the Cells. If you want to get the rows in the same order as on screen, use the GetSortedDataRows method. Here’s some (untested) code:<code>foreach(Xceed.Grid.DataRow row in grid.GetSortedDataRows(true))
{
foreach(Xceed.Grid.Cell cell in row.Cells)
{
cell.EnterEdit(); // activate the cell editor of the cell
Xceed.Grid.ICellEditor editor = cell.CellEditor;
… // do stuff with the editor
cell.LeaveEdit(true); // de-activate the cell editor and commit the value to the cell
}
}</code>
If you don’t need the cell editor, and you just want to manipulate/examin the value of the cells, you don’t need the <i>cell.EnterEdit() … cell.LeaveEdit(true)</i> block: you can just use the property <i>cell.Value</i>.Imported from legacy forums. Posted by Tommy (had 235 views)
I think we’re getting our wires crossed here.
I’m not talking about programmatically finding the cells in code. I’ve talking about getting the testing tool to programmatically find them. The testing tool only knows of properties that are exposed in the controls.
I’ve tried setting the AccessibleRole to type Table to see if this gave the tool more control but the grid didn’t expose anything more…
Imported from legacy forums. Posted by AutomatedQA (had 398 views)
Then I’m sorry, but I can’t help you there. I know the grid supports Accessibility, but I don’t know about the accessibility of the CellEditors.
Imported from legacy forums. Posted by Tommy (had 311 views)
Thanks.
Spent a bit of time on this over the weekend.
Used the inspect32.exe app from Microsoft
http://www.microsoft.com/downloads/details.aspx?FamilyId=3755582A-A707-460A-BF21-1373316E13F0&displaylang=enUsing inspect32 I was able to navigate, by calling the next child method and after calling this several times I got into a cell. So it looks like the grid control is working.
There is method in the Functional tool to create an ITestDataTable object and call GetTestData on it. However at the moment it’s returning an empty reference.
I’ll start posting on the IBM site to see if I can find out why.
If I find a solution I’ll post it here.
Carl
Imported from legacy forums. Posted by AutomatedQA (had 385 views)
Carl,
Did you find a solution to using Robot to identify Xceed Grid object? I am currently exploring that option and would appreciate any help.
Thanks,
MripalImported from legacy forums. Posted by mripal (had 6876 views)
-
AuthorPosts
- You must be logged in to reply to this topic.