User (Old forums)MemberApril 12, 2005 at 1:12 amPost count: 23064
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.NET
At 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.
Imported from legacy forums. Posted by AutomatedQA (had 941 views)User (Old forums)MemberApril 12, 2005 at 1:38 amPost count: 23064
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)User (Old forums)MemberApril 12, 2005 at 5:22 pmPost count: 23064
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)User (Old forums)MemberApril 13, 2005 at 2:29 amPost count: 23064
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
Imported from legacy forums. Posted by Tommy (had 843 views)User (Old forums)MemberApril 13, 2005 at 8:57 pmPost count: 23064
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)User (Old forums)MemberApril 14, 2005 at 1:39 amPost count: 23064
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
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)User (Old forums)MemberApril 14, 2005 at 10:31 pmPost count: 23064
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)User (Old forums)MemberApril 15, 2005 at 1:38 amPost count: 23064
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)User (Old forums)MemberApril 17, 2005 at 5:54 pmPost count: 23064
Spent a bit of time on this over the weekend.
Used the inspect32.exe app from Microsoft
Using 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.
Imported from legacy forums. Posted by AutomatedQA (had 385 views)
- You must be logged in to reply to this topic.