Forum Discussion

kavansays's avatar
kavansays
Contributor
10 years ago

TestedApps object properties

I am trying to create Tested app runrime, i am trying to cover below scenario..

 

If MyTestedApp Exist in project -> update properties

If MyTestedApp not Exist in project -> Create My Tested App with specific properties.

 

Here i am trying to create my tested app with below specified properties but failed to create it with specifies properties..

 

Requirement:

Name= Mytestedapp

Runmode = simple
Count = 1
autorun application on recording = false
launch application from tests = false
application: ..\..\..\..\Applications\InDMSApp_QA\bin\start_dms.bat
command-line parameters:
working folder: E:\AutomationDir

 

Actually created with below properties:

Name= Mytestedapp
Runmode = simple
Count = 1
autorun application on recording = false
launch application from tests = false
application:
command-line parameters: ..\..\..\..\Applications\InDMSApp_QA\bin\start_dms.bat
working folder: 

 

Below is the code i used:

sAutoAppPath = "E:\AutomationDir\start_dms.bat"

ind = TestedApps.Add(sAppName, Application = sAutoAppPath , count = 1, launch = True, WorkDir = "E:\AutomationDir ")

 

Can anyone please suggest how to update application parameter(highlighted below) through code ?

 

Untitled1.jpg


  • @kavanshah wrote:

     

    Below is the code i used:

    sAutoAppPath = "E:\AutomationDir\start_dms.bat"

    ind = TestedApps.Add(sAppName, Application = sAutoAppPath , count = 1, launch = True, WorkDir = "E:\AutomationDir ")


    VBScript doesn't support the ParamName = Value syntax in subroutine calls. You need to specify just the parameter values in the appropriate order:

     

    sAutoAppPath = "E:\AutomationDir\start_dms.bat"
    ind = TestedApps.Add(sAutoAppPath, "", 1, True, "E:\AutomationDir")

     

    Note that the default name for items in TestedApps is the file name component of the path, in your example it will be start_dms. You can specify a custom name for the added app like this:

     

    TestedApps.Items(ind).ItemName = "INDMS_QA"
  • HKosova's avatar
    HKosova
    10 years ago

    The application path is the first parameter of the TestedApps.Add method:

     

    ind = TestedApps.Add("%AutoDir%\Applications\InDMSApp_QA\bin\start_dms.bat", "", 1, True, "E:\AutomationDir")

    Or, using a variable:

     

    sAutoAppPath = "%AutoDir%\Applications\InDMSApp_QA\bin\start_dms.bat"
    ind = TestedApps.Add(sAutoAppPath, "", 1, True, "E:\AutomationDir")

     

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    @kavanshah wrote:

     

    Below is the code i used:

    sAutoAppPath = "E:\AutomationDir\start_dms.bat"

    ind = TestedApps.Add(sAppName, Application = sAutoAppPath , count = 1, launch = True, WorkDir = "E:\AutomationDir ")


    VBScript doesn't support the ParamName = Value syntax in subroutine calls. You need to specify just the parameter values in the appropriate order:

     

    sAutoAppPath = "E:\AutomationDir\start_dms.bat"
    ind = TestedApps.Add(sAutoAppPath, "", 1, True, "E:\AutomationDir")

     

    Note that the default name for items in TestedApps is the file name component of the path, in your example it will be start_dms. You can specify a custom name for the added app like this:

     

    TestedApps.Items(ind).ItemName = "INDMS_QA"
    • kavansays's avatar
      kavansays
      Contributor

      Thanks @HKosova,

       

      I am able to create testedapp (with or without param) with above specified statement but, my problem is to pass value for application parameter, plese check the image below, i want to pass value for "Application" field while creating tested app.Untitled1.jpg

      • HKosova's avatar
        HKosova
        SmartBear Alumni (Retired)

        The application path is the first parameter of the TestedApps.Add method:

         

        ind = TestedApps.Add("%AutoDir%\Applications\InDMSApp_QA\bin\start_dms.bat", "", 1, True, "E:\AutomationDir")

        Or, using a variable:

         

        sAutoAppPath = "%AutoDir%\Applications\InDMSApp_QA\bin\start_dms.bat"
        ind = TestedApps.Add(sAutoAppPath, "", 1, True, "E:\AutomationDir")