There are 3 ways in which we can luanch application in qtp.
You should use only systemutil.Run method to launch application. Invokeapplication is outdated method.
systemutil.Run file, [params], [dir], [op], [mode]
Operation can take below values.
Mode Can take below values
- systemutil.run
- invokeapplication -
- wscript.shell object
You should use only systemutil.Run method to launch application. Invokeapplication is outdated method.
systemutil.Run file, [params], [dir], [op], [mode]
- file -The name of the file you want to run.
- params - If the specified file argument is an executable file, use the params argument to specify any parameters to be passed to the application.
- dir - The default directory of the application or file.
- op - The action to be performed. If this argument is blank ( ""), the open operation is performed.
- Mode - Specifies how the application is displayed when it opens.
Operation can take below values.
- 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.
- edit - Launches an editor and opens the document for editing. If the FileName argument does not specify an editable document file, the statement fails.
- explore - Explores the folder specified by the FileName argument.
- find - Initiates a search starting from the specified folder path.
- 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