Forum Discussion

ChandanD's avatar
ChandanD
Contributor
5 years ago

The object "HwndSource_ShellView" does not exist.

 

When I execute the script on my local machine it is working fine and it is able to identify the window correctly. 

But when I execute the same script via Jenkins it is giving error message of Unable to find "HwndSource_ShellView"

 

Could anyone let me know the reason why am I getting the error message.

 

unction viewhelp()
{
  
    var testStandDesigner = Aliases.TestStandDesigner;
      /// Launching latest version of teststand designer application
      var ExistingApp=Aliases.TestStandDesigner;
              
      if(ExistingApp.Exists)
      {
        ExistingApp.Close();
        if(Aliases.TestStandDesigner.dlgTeststandDesigner.Exists)
        {
          Aliases.TestStandDesigner.dlgTeststandDesigner.btnYes.Click();
        }
      }
      //var StrApplName = "C:\\KBApps\\TeststandDesigner\\TeststandDesignerCtrl.exe";
      var path = Project.Path;
      Log.Message(path);
      var StrApplName = path+"..\\..\\..\\TestStand_Designer\\TeststandDesigner\\Lib\\Assembly\\TeststandDesignerCtrl.exe";
      Log.Message(StrApplName)
      TestedAppIndex= TestedApps.Add(StrApplName)
      TestedApps.Items(TestedAppIndex)
      TestedApps.Items(TestedAppIndex).Run()
    var titleBar=Aliases.TestStandDesigner.HwndSource_ShellView;
    Mainform = testStandDesigner.WaitAliasChild("HwndSource_ShellView",50000)
   
    //WshShell.Run(StrApplName);
    titleBar.SetFocus()
    titleBar.Activate()
    titleBar.Maximize()
//      var StrApplName = path+"..\\..\\..\\TestStandDesigner\\Lib\\Assembly\\TeststandDesignerCtrl.exe";
//      WshShell.Run(StrApplName);
//      Delay(15000);
//      var titleBar=Aliases.TestStandDesigner.HwndSource_ShellView;
//      titleBar.Maximize();
//      
//      Delay(15000);
//
//      Log.Message("Teststand Designer Application Launched");
//      Delay(1000);
      
      
    
      var menupanel = testStandDesigner.FindChild(Array("ClrClassName","ClrFullClassName"),Array("Menu","System.Windows.Controls.Menu"),100);
      
      var panelhelp = menupanel.WPFMenu.Click("Help|Help   F1");
      
      Delay(2000);
      
      var helpwindow = testStandDesigner.FindChild(Array("WndCaption","WndClass"),Array("TSD Help Documentation","HH Parent"),100);
      helpwindow.Close();
      
      var ExitApp = menupanel.WPFMenu.Click("Project|Exit");
      
}