How do i click an item
This is my function:
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)
ProjectsArray[j].Items.Item(i).Click();
//Aliases.QuickDesign_ConfigurationManager.HwndSource_This2.This.FunctionalItemsControl.Tree.TreeViewItem.WPFObject("TreeViewItem", "", i+1).Click();
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()
}
}
this line return an error
ProjectsArray[j].Items.Item(i).Click();
How do i click/select/focus an item in this case?
Thanks
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()
}