power_settings_new

Coded UI Test - Datagrid

by
+1 vote
192 views
Hi all,

Can you someone tell me please how can I click on Column OrderId with with value what I want ? What I must to use WinTable ?

https://postimg.org/image/ja4at2azr/

https://postimg.org/image/t9z9r5kql/

This not work for me ?

            WinTable ordersWinodws = new WinTable();

            ordersWinodws.TechnologyName = "MSAA";

            ordersWinodws.SearchProperties[UITestControl.PropertyNames.Name] = "Orders";

            ordersWinodws.SearchProperties[UITestControl.PropertyNames.ClassName] = "TForm1";

            WinTable tdbgridtable = new WinTable(ordersWinodws);

            tdbgridtable.SearchProperties[UITestControl.PropertyNames.ClassName] = "TcxGridSite";
by (171 points)
Is that an HTML table?
by
No this is window application DataGrid.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

2 Answers

by
0 votes

If I do this I don't get any result of DataGrid ?

 

 

 

            UITestControl tblGrid = new WinTable(ordersWinodws);
            UITestControlCollection controlCol = tblGrid.FindMatchingControls();
            var controls = controlCol.Select(x => x.Name);
            foreach (var control in controls)
            {
                Console.WriteLine(control.ToString());
            }

 

by (171 points)
0 votes

Do you want to try using WpfCustom here?

 

 // Create Uia.Cell object
        WpfCustom tableCell = new WpfCustom(UIMap.ACVSClientApplication);
        tableCell.SearchProperties.Add("ClassName", "Uia.Cell");
by
Hi I try this but I get an error :


            WpfCustom tableCell = new WpfCustom(ordersWinodws);
            tableCell.SearchProperties.Add("ClassName", "TcxGridSite");

            Console.WriteLine(tableCell.Name.ToString());

But when I try this I get output Orders:

      WinCell tableCell1 = new WinCell(ordersWinodws);
            tableCell1.SearchProperties.Add("ClassName", "TcxGridSite");

            Console.WriteLine(tableCell1.FriendlyName.ToString());

But how Can I click on value on cell ?
by (171 points)
Try below code..

Point point = tableCell1.GetClickablePoint();
Mouse.Click(tableCell1, point);
add
...