Sunday 10 March 2013

Different ways of launching application in qtp

  There are 3 ways in which we can luanch application in qtp.

  1.     systemutil.run
  2.     invokeapplication -
  3.     wscript.shell object


You should use only  systemutil.Run method to launch application. Invokeapplication is outdated method.

systemutil.Run file, [params], [dir], [op], [mode]



  1. file -The name of the file you want to run. 
  2. params  - If the specified file argument is an executable file, use the params argument to specify any parameters to be passed to the application. 
  3. dir  - The default directory of the application or file. 
  4. op  - The action to be performed. If this argument is blank ( ""), the open operation is performed.
  5. Mode - Specifies how the application is displayed when it opens.

Operation can take below values.

  1. open -  Opens the file specified by the FileName parameter. The file can be an executable file, a document file, or a folder. Non-executable files are open in the associated application. 
  2. edit   - Launches an editor and opens the document for editing. If the FileName argument does not specify an editable document file, the statement fails. 
  3. explore -   Explores the folder specified by the FileName argument. 
  4. find  -  Initiates a search starting from the specified folder path. 
  5. print   - Prints the document file specified by the FileName argument. If the specified file is not a printable document file, the statement fails. 


Mode Can take below values


  • 0  Hides the window and activates another window. 
  • 1   Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. Specify this flag when displaying the window for the first time. 
  • 2   Activates the window and displays it as a minimized window. 
  • 3   Activates the window and displays it as a maximized window. 
  • 4   Displays the window in its most recent size and position. The active window remains active. 
  • 5   Activates the window and displays it in its current size and position. 
  • 6   Minimizes the specified window and activates the next top-level window in the Z order. 
  • 7   Displays the window as a minimized window. The active window remains active. 
  • 8   Displays the window in its current state. The active window remains active. 
  • 9   Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. Specify this flag when restoring a minimized window. 
  • 10   Sets the show-state based on the state of the program that started the application. 







No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.