Hi,
I am trying to write a Coded UI project to get all the values in a column of an UltraGrid.
I have an UltraWinGrid with more rows than can be displayed on screen, so there are rows that have to be scrolled to be visible.
I have a Coded UI project that can iterate through all currently visible rows and get cell values.
I could send keystrokes to key down the grid, eg
1. Select Grid2. Ctrl-Home to guarantee top row is top3. Page Down so that top row is still top, but cursor is at bottom visible row4. Read top row5. Send down cursor keystroke. 6. Go to 4 until we are at bottom7. Iterate through remaining visible rows.
My question is how do I know that I am at the bottom of the grid (step 6)
I am using 2012 volume 2. .Net 4.0 application.The test project is in Visual Studio 2012 .Net 4.5.
Thanks
David
Hi Chris (me again :))
I managed to find the way for previous problem, now there is another one.
Is it possible to find the actions UltraGrid row. The one that is used to add new row to the grid when i double click on it?
Best
Hi Chris
Is it possible to get NativeElement row value if i have UITestControl that represents one row in the grid.
Thanks Chris
I already found that when i do GetChildren[0] on ultraCell it returns the control that is clickable, so i will continue that way.
For the rows i will then do Click on a point... I will let you know if there is any other way.
Almir Tucakovic
The issue is that when you call Mouse.Click() or similar methods, the Coded UI Framework, looks for a clickable point on the UITestControl you provide. If it cannot find a clickable point (such as when there is a child AutomationElement that covers the entire bounds of the provided UITestControl), it will fail with the blocked message.
For instance, in the code I provided, I created UITestControls for the Row, the Cell and the Editor's DataArea. The Mouse.Click()/DoubleClick() is on the DataArea TestControl, as that covers the cell for our editors that take text input. Depending on the cell's editor, you might need to go further into the hierarchy creating UITestControls before performing the click.
When a cell is in edit-mode, there is a TextBox overlaying the cell, so you will need to interact with that. I'd suggest using the CodedUITestBuilder to generate the code for the EmbeddableTextBox hierarchy to make it easier.
Inspect is a good tool to see the hierarchy and the bound of the AutomationElements to see if an AutomationElement is fully covered by child elements.
Clicking on a Row may be a bit trickier. Most of the row is covered by cells and only part of the area not covered by cells will respond to a mouse click. I believe there is a Mouse.Click() overload that takes a Point. You may need to utilize this method, and pass it a point that corresponds to the RowSelector on the row.
Let me know if you need further details.
Chris
Hi
Could you help me with something Chris.
First it finds the control (Row or cell) really fast and when i do DrawHighLight() it finds and rounds the control in milliseconds which is great, however.
In this case (and i other cases like text box, combo box) i am having issue with Mouse.Click , adding text actions.
After I find the control i try to do mouse click or enter text and it focuses ultra control but it is not clicking or entering text (if it is textbox...).
after some time it shows exception like some other control is blocking.. or something else.
Same case is here with Row or cell when i try to click on it.
For textboxes
It is not problem to get the data from it but to enter the data is something else ...