2gis / Winium.Cruciatus

C# Framework for automated testing of Windows application based on WinFroms and WPF platforms.
Mozilla Public License 2.0
137 stars 66 forks source link

Help me on how to get the list items using Cruciatus, i tried multiple ways but no luck, some ne please guide me #87

Open knarunkumargit opened 5 years ago

knarunkumargit commented 5 years ago

CruciatusElement accountFunctionControl = quest.FindElementByUid("SelectAccountFunctionControl"); accountFunctionControl = accountFunctionControl.FindElementByUid("displayBlock1"); accountFunctionControl = accountFunctionControl.FindElementByUid("displayBlockContentPanel1"); accountFunctionControl = accountFunctionControl.FindElementByUid("SearchDialog");

        CruciatusElement lookForControl = accountFunctionControl.FindElementByUid("4002");
        lookForControl.FindElementByUid("1001").SetText("#");

        accountFunctionControl.FindElementByUid("4006").ToComboBox().Expand();
        accountFunctionControl.FindElementByUid("4006").ToComboBox().FindElement(Winium.Cruciatus.Core.By.Name("Name")).Click();
        accountFunctionControl.FindElementByUid("1").Click();

        //ListBox listBox = accountFunctionControl.FindElementByUid("4004").ToListBox();

        Winium.Cruciatus.Elements.DataGrid grid = accountFunctionControl.FindElementByUid("4004").ToDataGrid();

        Winium.Cruciatus.Elements.ListBox list = accountFunctionControl.FindElementByUid("4004").ToListBox();

        var getValues = accountFunctionControl.FindElements(ByXPath.XPath(".//*[@AutomationId='4004']"));
        var getValues1 = accountFunctionControl.FindElements(Winium.Cruciatus.Core.By.XPath(".//*[@AutomationId='4004']"));

        var items=  list.FindElements(Winium.Cruciatus.Core.By.XPath("./*[contains(@LocalizedControlType, 'list item')]"));
        var grids = grid.FindElements(Winium.Cruciatus.Core.By.XPath("./*[contains(@LocalizedControlType, 'list item')]"));

        var items23 = list.FindElements(Winium.Cruciatus.Core.ByXPath.XPath("./*[contains(@LocalizedControlType, 'list item')]"));
        var grids23 = grid.FindElements(Winium.Cruciatus.Core.ByXPath.XPath("./*[contains(@LocalizedControlType, 'list item')]"));

        var getValues2 = accountFunctionControl.FindElements(ByXPath.XPath(".//*[@AutomationId='4004' and @LocalizedControlType='list item']"));

image