Forum Discussion
Abramova
Staff
14 years agoHi,
The highlighted statement actually checks whether the ["WaitWPFObject"]("TextBlock", FileWithoutExt, 10000) object exists. When TestComplete calls the Exist method of this object, first it checks whether the parent object exists. As the WPFObject("TabItem", "", 1) does not exist at that moment, TestComplete cannot obtain its children, including the TextBlock object. So, the error occurs and the test is stopped.
If you need to check whether the tab is created, you need to verify whether the TabItem object exists. For example:
if(Aliases["FusionDesktop"]["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["WPFObject"]("ContentPanel")["WPFObject"]("PART_SelectedContentHost")["WPFObject"]("AssemblyViewTabControl")["WPFObject"]("Grid", "", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("UserControl")["WPFObject"]("UserControl")["WPFObject"]("TabItem", "", NumberOfTabs)["Exists"])
{
...
}
else
{
...
}