Forum Discussion

jimmykilleen's avatar
jimmykilleen
New Contributor
6 years ago
Solved

Get Exe version number from Host

Hi All,

 

Currently working on a distributed setup where I have a server that runs test execute at a scheduled time to execute the project suite. The project suite includes a list of jobs that are run accross a couple of Hosts. 

 

At the end of the test run, I am saving the results file to a location & renaming it with the version\build of the exe run on the host(s). I have tried using the Sys.Process.FileVersionInfo (see code below) but this wont work because  the exe  (MyExe.exe) is not present on the Server where the test run is kicked off. Therefore I get errors that the process was not found.  I have also investigated using various variables (Project, ProjectSuite & NetworkSuite) but these dont seem to work for me either.

 

Sub LogFinalResultsAndEmail
'This Routine will Export the Results Log to the Folder below & will also Rename the log to the build version.
'It will then email these Results to the specified email addresses.
sFolder = "\\Server1\TestComplete\Project1\Results\"
aqFileSystem.CreateFolder(sFolder)
FileName = sFolder & "\Build_" &Sys.Process("MyExe").FileVersionInfo & "\MyExe_Build_"& Sys.Process("MyExe").FileVersionInfo & "_" & Sys.HostName & ".mht"

Log.SaveResultsAs FileName, 2
Call SendEmail ("relay@email.com", "myemail@email.com","Test Results: MyExe Build Version "& Sys.Process("MyExe").FileVersionInfo,"Full Test Results for MyExe Build Version "& Sys.Process("MyExe").FileVersionInfo& " are available by clicking the following link. The results file (.mht) opens in Internet Explorer. " & "<a href="&FileName&"> Test Results</a> "&". Please do not reply to this message. This email is an automated notification, which is unable to receive replies.")
End Sub

 

So my question is how can I get access to the exe version details from the remote host in order to name the results file accordingly. Any help greatly appreciated.

 

Thanks,

Jimmy

  • Rather than logging the exe version in the project that launches the distributed test, you should include in that remote project the code to find the exe version and store it into the log on that distributed machine.  As I recall, that distributed log is then brought over to the master machine for final logging and reporting so that it will be embedded in that log.  

    If you want the exported files to be versioned with the exe version, then you should do the export on the slave projects rather than on the master so that you have individual log files for each exe.

  • Hi Jimmy,

     

    Generally, I am with Robert.

    But you may consider WMI to connect to the remote host and trigger some code on it which will get and return the info about .exe.

     

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Rather than logging the exe version in the project that launches the distributed test, you should include in that remote project the code to find the exe version and store it into the log on that distributed machine.  As I recall, that distributed log is then brought over to the master machine for final logging and reporting so that it will be embedded in that log.  

    If you want the exported files to be versioned with the exe version, then you should do the export on the slave projects rather than on the master so that you have individual log files for each exe.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Jimmy,

     

    Generally, I am with Robert.

    But you may consider WMI to connect to the remote host and trigger some code on it which will get and return the info about .exe.

     

    • jimmykilleen's avatar
      jimmykilleen
      New Contributor

      Yes both options are possibilities for me Thanks