Forum Discussion
Oferv
14 years agoSuper Contributor
Hi,
yes i know that this is how TC is working but the last object TC is looking for is not exist,it's not something on the way.
I'm looking to see if TabItem is exist.
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"])
if this line result True there's no problem the script is running properly but if this line is False i expect it to move on to the else statement and not stopping the script.
:
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"])
{
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)["WPFObject"]("UserControl")["WPFObject"]("StackPanel", "", 1)["WaitWPFObject"]("TextBlock", FileWithoutExt, 10000)["Exists"])
{
Log["Message"]("File " + "'" + File + "'" + " opened properly,New tab was created for it")
//Stop the time counter
TimeToolDocumentFullyLoad.Stop();
// Posts the elapsed time to the test log
Log.Message("The time took the document to load is : " + TimeToolDocumentFullyLoad.ToString());
}
else
{
Log["Warning"]("File " + "'" + File + "'" + " wasn't open properly,No tab created")
}
}
else
Log["Warning"]("File " + "'" + File + "'" + " wasn't open properly,No tab created")
yes i know that this is how TC is working but the last object TC is looking for is not exist,it's not something on the way.
I'm looking to see if TabItem is exist.
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"])
if this line result True there's no problem the script is running properly but if this line is False i expect it to move on to the else statement and not stopping the script.
:
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"])
{
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)["WPFObject"]("UserControl")["WPFObject"]("StackPanel", "", 1)["WaitWPFObject"]("TextBlock", FileWithoutExt, 10000)["Exists"])
{
Log["Message"]("File " + "'" + File + "'" + " opened properly,New tab was created for it")
//Stop the time counter
TimeToolDocumentFullyLoad.Stop();
// Posts the elapsed time to the test log
Log.Message("The time took the document to load is : " + TimeToolDocumentFullyLoad.ToString());
}
else
{
Log["Warning"]("File " + "'" + File + "'" + " wasn't open properly,No tab created")
}
}
else
Log["Warning"]("File " + "'" + File + "'" + " wasn't open properly,No tab created")