Forum Discussion

ringraham's avatar
ringraham
Contributor
10 years ago

pass executable name to test script

Currently we use a "TestedApps" executable for use in our test scripts; ie. TestedApps.[Executable Name].Run();

 

We would like to be able to pass the executable name to TestExecute as an input parameter that is based on the build number in the directory. Is there a way to do this? Or is there a way to modify the "TestedApps" file location via command line?  This is for testing a nightly build.

 

Thanks.

 

-Ron

  • I don't think you can change it from the TestExecute command line, but what you could do is put that build name in a file or an Excel sheet and just let the test script read it from there every time.

    • ringraham's avatar
      ringraham
      Contributor

      Not a bad idea, but it only solves part of the problem. Even if I were to load the name from a file, I still cannot figure out how to "run" the file.

       

      The only way I can see to startup a desktop application is to add it to "TestedApps" and use the .Run() method as stated above: TestedApps.[Executable Name].Run();

       

      I cannot find an Execute(filename) command, or a RunFile(filename) or something like this. I even tried to simply load a variable with the filename to see if there was a "Run" method in desperation, but this obviously was not going to work and it didn't. Ex. var fileToRun = "C:\\[directory]\\[filename.exe]";  fileToRun.Run();

       

      Am I missing something really obvious here?  Is there another way to startup your app without adding it to TestedApps?

       

      Thanks again.

       

      -Ron