Forum Discussion

guido_welzel's avatar
13 years ago

Tested Apps for Project Suite

Hi,

I use a project suite with about 40 projects in it. All the projects share the same tested apps, which are renamed regularly. 

How do I define a tested app to a project suite?

  • write a simple script to update Application name in TestedApps from the file.



    Create a file in your suite folder. e.g path.csv and mention you application path and executable name in second line of csv file for example.



    Path,exeName

    c:\\Drops\\,Application.exe



    you have to create one more schema.ini file in same project suite folder to parse the csv and paste the following content in it.



    [path.csv]

    Format=CSVDelimited

    ColNameHeader=True

    MaxScanRows=0



    Replace TestedApps.Application.Run(1) command in your projects' scripts with following function. Now you have to rename application name only in csv file and Open_App function will update the name in TestedApps as the script will run.



    function Open_App()

    {

     

       DDT.CSVDriver("..\\path.csv");  //looking for a path.csv just above the project dir.

     

       var strPath, strExe;

     

      if (! DDT.CurrentDriver.EOF()) // not using loop bcoz we have only one value in csv.

      {

        strPath = DDT.CurrentDriver.Value("Path");

        strExe = DDT.CurrentDriver.Value("exeName");

     

        TestedApps.Appliction.Path = strPath;

        TestedApps.Appliction.FileName = strExe;

        TestedApps.Application.Run(1);    

      }

      else

      {

        Log.Message ("Path not found");

      }

      

      // Closes the driver

      DDT.CloseDriver(DDT.CurrentDriver.Name); 

    }