Forum Discussion

anandmar24's avatar
anandmar24
Occasional Contributor
11 years ago

Open an application/Process without using TestedApp

Hi All,



I want to run a process without using TestedApp since we need to change the location of the application everytime when we want to run in different machine. Is there any way for achieving it in TestComplete?
  • There are at least 3 ways do achieve what you need:



    1. Dynamically change path to TestedApp

    http://support.smartbear.com/viewarticle/27354/



    2. Use WScript.Shell

    Sys.OleObject("WScript.Shell").Run("C:\\Windows\\notepad.exe", SW_SHOWNORMAL);



    3. Use WinAPI

    Win32API.WinExec("C:\\Windows\\notepad.exe", SW_SHOWNORMAL);
  • karkadil's avatar
    karkadil
    Valued Contributor
    There are at least 3 ways do achieve what you need:



    1. Dynamically change path to TestedApp

    http://support.smartbear.com/viewarticle/27354/



    2. Use WScript.Shell

    Sys.OleObject("WScript.Shell").Run("C:\\Windows\\notepad.exe", SW_SHOWNORMAL);



    3. Use WinAPI

    Win32API.WinExec("C:\\Windows\\notepad.exe", SW_SHOWNORMAL);
  • anandmar24's avatar
    anandmar24
    Occasional Contributor
    Thanks Gena.



    I actually wanted to use a local variable for setting a path. I found it using Path property of TestedApps.



    Thanks for the instant support which drives us to use TestComplete.