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
hehe, just looking at it :D
I will get back to you soon. Currently working on big changes related to this part so when i test it i will let you know the results.
Best
Just saw that part of my previous post was blocked. It should be:
dataAreaControl.SearchProperties.Add( new PropertyExpression ( UltraUiaControl.PropertyNames.AutomationId, "[Editor]", PropertyExpressionOperator.Contains ) ); dataAreaControl.Find();
Mouse.DoubleClick(dataAreaControl);
break;
Hey Almir.
To perform a click at this point, you have two options.
Using UIA only : Get a clickable point from the AutomationElement() and call Mouse.Click() on that point.
http://stackoverflow.com/questions/10105396/given-an-automation-element-how-do-i-simulate-a-single-left-click-on-it
Using the CodedUI framework: Create a UITestControl for cell's editor, and call Mouse.Click() on the UITestControl. Note that in order to create a TestControl, you'd work your way down the hierarchy finding all the appropriate intermediate objects.
if (valuePattern.Current.Value == "KK") { UITestControl rowTestControl = new UITestControl(uIColScrollRegion0RowSTree); rowTestControl.SearchProperties.Add(UltraUiaControl.PropertyNames.AutomationId, rowAutomationElement.Current.AutomationId); rowTestControl.Find();
UITestControl cellTestControl = new UITestControl(rowTestControl); cellTestControl.SearchProperties.Add(UltraUiaControl.PropertyNames.AutomationId, cellAutomationElement.Current.AutomationId); cellTestControl.Find();
UITestControl dataAreaControl = new UITestControl(cellTestControl); dataAreaControl.SearchProperties.Add(new PropertyBLOCKED EXPRESSION;
break; }
Let me know how this turns out.
Chris
Is it possible to select, click etc. on desired (cell or row) while looping through them.
Let's say I want to find some row which have cell with desired value and Double Click on it (row or cell) to open next form...
Almir
AMAZING AMAZING :)
Thanks a lot.