Forum Discussion

OV's avatar
OV
Frequent Contributor
7 years ago
Solved

How do i click an item

This is my function:   function SelectSeries(SeriesIndex) { PropArray = "WPFControlText" ValuesArray = "Printer*" ProjectsArray = Aliases.QuickDesign_ConfigurationManager.HwndSource_This2.This....
  • OV's avatar
    7 years ago

    SOLVED

     

    // Select Series for printer
    // Index - The index of the series to add from the combobox
    function SelectSeries(SeriesIndex)
    {
    PropArray = "WPFControlText"
    ValuesArray = "Printer*"
    ProjectsArray = Aliases.QuickDesign_ConfigurationManager.HwndSource_This2.This.FunctionalItemsControl.Tree.FindAllChildren("ClrClassName", "TreeViewItem", 1).toArray()
    for(j = ProjectsArray.length - 1 ; j >= 0 ; j--)
    {
    Log.AppendFolder("Set series for printers list under " + ProjectsArray[j].DataContext.Project.Name.OleValue)
    ProjectsArray[j].Click();
    PrintersArray = ProjectsArray[j].FindAllChildren("WPFControlText", "Printer*", 6).toArray()
    for( i = 0; i < PrintersArray.length; i++)
    {
    Log.Message(ProjectsArray[j].Items.Item(i).Name.OleValue)

    SeriescomboBox = Aliases.QuickDesign_ConfigurationManager.HwndSource_This2.This.Grid.AppStateGrid.ComboboxSeries
    Aliases.QuickDesign_ConfigurationManager.HwndSource_This2.This.Grid.AppStateGrid.ComboboxSeries.ClickItem(Random(0, 11));
    Log.Message("Series ComboBox value - " + ProjectsArray[j].Items.Item(i).Name.OleValue)
    SelectModel(Random(0, 3))
    }
    Log.PopLogFolder()
    }