HP QTP Utility Statements : InvokeApplication Statement
September 10, 2018
HP QTP Utility Statements : InvokeApplication Statement
Welcome to this post! – ” HP QTP Utility Statements : InvokeApplication Statement”.
If you are looking for HP UFT, QTP utility statements and their usages, then you are at right place. This post “HP QTP Utility Statements : InvokeApplication Statement” consists of concept discussion and usage discussion. Go ahead and enjoy reading…
This discussion will help you prepare well if you are going for the interview and can help you if you need the function to be used in your project test suite.
InvokeApplication Statement
Abstract
The InvokeApplication statement is used to start the application. It doesn’t matter which technology build application you are trying to run and open. The statement in itself falls under the category of utility statements and not utility objects. Remember there is a difference between utility statements and utility objects.
Before we dig down deep into the usage let’s quickly visit some general questions.
In the interview usually, you might be questioned in different ways like:
- How to get your windows application invoked in the test run?
- Can you associate the parameters to the InvokeApplication statement?
- What are the objects and parameters of InvokeApplication statement?
- is InvokeApplication is an object or statement?
- What is the difference between systemutil.run and invokeapplication?
Discussion
In most of the testing scenarios we try opening the application via script. In this script we use InvokeApplication statement for invoking the targeted application along with any parameters. Officially, this statement can invoke any executable application.
But there is difference between InvokeApplication and SystemUtil. You must use the InvokeApplication statement only when you are targeting the some old versions of the application which is why it is quite recommended that it is to be used primarily for backward compatibility.
Points to note here:
- You can add this statement manually in the Expert View.
- It is to be used primarily for backward compatibility.
- If the invokeapplication statement fails to open the application, a “False” value is returned.
Syntax
InvokeApplication(Command [,StartIn])
Return Value
Boolean.
Let’s see the parameters and their usage description for this statement:
Argument | Type | Description |
Command | String | This is Mandatory. The path and command line options of the application to invoke. |
StartIn | String | This is Optional. The working folder to which the Command path refers. |
Example
The following example uses the InvokeApplication function to open Internet Explorer.
'example invokeapplication InvokeApplication "E:\Program Files\Microsoft Internet\IEXPLORE.EXE"
This brings us to the end of our discussion on “HP QTP Utility Statements : InvokeApplication Statement”.
I really hope you have enjoyed reading this short post. If you have any doubt on this please feel free to add your comment below.
And if you like to read more on UFT or QTP Technical Interview Questions please follow below links:
UFT Technical Interview Questions – Set 1
UFT Technical Interview Questions – Set 2
How to Download Resource From QC\ALM?
How to Upload Resource To QC\ALM?
Or if you prefer General Interview Questions please follow below links:
UFT General Interview Questions – Part 1
UFT General Interview Questions – Part 2
If you would like to keep track of further articles on UFT (QTP). I recommend you to SUBSCRIBE by Email and have new UFT articles sent directly to your inbox.