public static void startApplicationTest( string ApplicationExecutable, AppAutomationBase automationClass ) { setApplicationLocationForExcel( ); Application holodeckApplication; Application AUTApplication; TestFramework.Log.Log.printSuccess( "STARTING HOLODECK with AUT." ); // Start Notepad in Holodeck monitoring it... holodeckApplication = new Application( startHolodeck ( ApplicationExecutable ) ); TestFramework.Log.Log.printSuccess( "STARTING Monitor Thread for Holodeck." ); // Start Monitoring the Holodeck Process... holodeckApplication.StartMonitoring( ); TestFramework.Log.Log.printSuccess( "FINDING the AUT Process", ApplicationExecutable ); // Get information about the AUT that Holodeck started... ProcessTools.ProcessTools tools = new ProcessTools.ProcessTools( ); // Instantiate the application class based off of the child process ID created by Holodeck... AUTApplication = new Application( tools.GetChildProcess( holodeckApplication.ProcessClass.Id ) ); TestFramework.Log.Log.printSuccess( "STARTING Monitor Thread for AUT." ); // Start monitoring the AUT... AUTApplication.StartMonitoring( ); TestFramework.Log.Log.printSuccess( "RESUMING the AUT Process." ); // Resume the AUT... resumeAUT( ); TestFramework.Log.Log.printSuccess( "PERFORMING AUT Automation." ); automationClass.performAUTAutomation( AUTApplication.ProcessClass ); TestFramework.Log.Log.printSuccess( "SHUTTING DOWN Holodeck and AUT." ); // Shutdown Holodeck and the AUT... holodeckApplication.ProcessClass.Kill( ); AUTApplication.ProcessClass.Kill( ); TestFramework.Log.Log.printSuccess( "BUILDING Monitor File List", System.IO.Directory.GetCurrentDirectory( ) + "\\" + MonitorClassFile ); // We now need to build a file containing a list of the locations where the monitored log files are located... buildMonitorFileList( MonitorClassFile, holodeckApplication, AUTApplication ); // We must wait for the threads writing to the files to stop before continuing... holodeckApplication.MonitorClass.Stop( ); TestFramework.Log.Log.printSuccess( "CREATING Excel SpreadSheet for Holodeck", System.IO.Directory.GetCurrentDirectory( ) + "\\" + holodeckApplication.MonitorClass.logLocation + ".xls" ); // Open the excel document using the monitor file list... openExcelDocument( ExcelDocument, holodeckApplication ); // Remove the topmost file from the file list... moveMonitorFileListEntryUp( MonitorClassFile ); // Again we must wait for the threads to stop writing to files... AUTApplication.MonitorClass.Stop( ); TestFramework.Log.Log.printSuccess( "CREATING Excel SpreadSheet for AUT", System.IO.Directory.GetCurrentDirectory( ) + "\\" + AUTApplication.MonitorClass.logLocation + ".xls" ); // Open the excel document again using the monitor file list... openExcelDocument( ExcelDocument, AUTApplication ); // A document should have been generated in the local build folder... This document is an excel spreadsheet, // which when opened will trigger code to execute. }
public static void startApplicationTest(string ApplicationExecutable, AppAutomationBase automationClass) { setApplicationLocationForExcel( ); Application holodeckApplication; Application AUTApplication; TestFramework.Log.Log.printSuccess("STARTING HOLODECK with AUT."); // Start Notepad in Holodeck monitoring it... holodeckApplication = new Application(startHolodeck(ApplicationExecutable)); TestFramework.Log.Log.printSuccess("STARTING Monitor Thread for Holodeck."); // Start Monitoring the Holodeck Process... holodeckApplication.StartMonitoring( ); TestFramework.Log.Log.printSuccess("FINDING the AUT Process", ApplicationExecutable); // Get information about the AUT that Holodeck started... ProcessTools.ProcessTools tools = new ProcessTools.ProcessTools( ); // Instantiate the application class based off of the child process ID created by Holodeck... AUTApplication = new Application(tools.GetChildProcess(holodeckApplication.ProcessClass.Id)); TestFramework.Log.Log.printSuccess("STARTING Monitor Thread for AUT."); // Start monitoring the AUT... AUTApplication.StartMonitoring( ); TestFramework.Log.Log.printSuccess("RESUMING the AUT Process."); // Resume the AUT... resumeAUT( ); TestFramework.Log.Log.printSuccess("PERFORMING AUT Automation."); automationClass.performAUTAutomation(AUTApplication.ProcessClass); TestFramework.Log.Log.printSuccess("SHUTTING DOWN Holodeck and AUT."); // Shutdown Holodeck and the AUT... holodeckApplication.ProcessClass.Kill( ); AUTApplication.ProcessClass.Kill( ); TestFramework.Log.Log.printSuccess("BUILDING Monitor File List", System.IO.Directory.GetCurrentDirectory( ) + "\\" + MonitorClassFile); // We now need to build a file containing a list of the locations where the monitored log files are located... buildMonitorFileList(MonitorClassFile, holodeckApplication, AUTApplication); // We must wait for the threads writing to the files to stop before continuing... holodeckApplication.MonitorClass.Stop( ); TestFramework.Log.Log.printSuccess("CREATING Excel SpreadSheet for Holodeck", System.IO.Directory.GetCurrentDirectory( ) + "\\" + holodeckApplication.MonitorClass.logLocation + ".xls"); // Open the excel document using the monitor file list... openExcelDocument(ExcelDocument, holodeckApplication); // Remove the topmost file from the file list... moveMonitorFileListEntryUp(MonitorClassFile); // Again we must wait for the threads to stop writing to files... AUTApplication.MonitorClass.Stop( ); TestFramework.Log.Log.printSuccess("CREATING Excel SpreadSheet for AUT", System.IO.Directory.GetCurrentDirectory( ) + "\\" + AUTApplication.MonitorClass.logLocation + ".xls"); // Open the excel document again using the monitor file list... openExcelDocument(ExcelDocument, AUTApplication); // A document should have been generated in the local build folder... This document is an excel spreadsheet, // which when opened will trigger code to execute. }