SlideShare a Scribd company logo
1 of 4
Visit:   http://qtp12.blogspot.com/


                Ways to launch your application


Four different ways to launch your application are mentioned below:


1) SystemUtil.Run


SystemUtil.Run ( FileName, Parameters, Path, Operation )

FileName - The name of the file you want to run.

Parameters - If the specified FileName is an executable file, use the
Parameters argument to specify any parameters to be passed to the
application.

Path - The default directory of the application or file.

Operation - The action to be performed. If this argument is blank (""),
the open operation is performed.

The following operations can be specified for the operation argument
of the SystemUtil.Run method:

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.


                                                                            1
Example:SystemUtil.Run "D:My MusicBreathe.mp3","","D:My Music
Details","open"



2) InvokeApplication



This command is now mainly used for the backward compatability ie to
use with the lower versions(below QTP 6.0) of QTP.



InvokeApplication("Full URL as Parameter")

Example:InvokeApplication "C:Program FilesInternet
ExplorerIEXPLORE.EXE http://www.yahoo.com"



3) VBscript to invoke application



1. Create a "WScript.shell" object.

2. Use the "run" object to launch the application. If the path to your
executable contains spaces, use Chr(34) to ensure the path is
contained within double quotes.

3. When done, set the shell object to nothing to release it.



Example:

Dim oShellSet oShell = CreateObject ("Wscript.shell")'

Example 1 - run a batch file:oShell.run
"F:jdk1.3.1demojfcSwingSet2.bat"'

Example 2 - run a Java jar file:oShell.run "java -jar F:jdk1.3.1demo


                                                                         2
jfcSwingSet2SwingSet2.jar"'

Example 3 - launch Internet Explorer:oShell.Run Chr(34) &
"C:Program FilesInternet ExplorerIEXPLORE.EXE" & Chr(34)Set
oShell = Nothing



4) Trivial but useful method



If nothing works out you might try this



You can use the Start -> Run dialog of Windows.

1. Add the Windows Start button to the Object Repository using the
"Add Objects" button in Object Repository dialog.

2. Open the Run dialog (Start -> Run), and learn the "Open" edit field
and the "OK" button into the Object Repository.

3. Switch to the Expert View, and manually add the lines to open the
Run dialog.

Example:Window("Window").WinButton("Button").ClickWindow("Windo
w").Type("R")

4. Manually enter the lines to enter the information to launch the
application, and click the "OK" button of the Run dialog.



Example:

Dialog("Run").WinEdit("Open:").Type
"c:WINNTsystem32notepad.exe"

Dialog("Run").WinButton("OK").Click




                                                                         3
If you want to keep track of further articles on QTP. I recommend you
to subscribe via RSS Feed. You can also subscribe by Email and have
new QTP articles sent directly to your inbox.




                                                                        4

More Related Content

What's hot

Error Handling in Swift
Error Handling in SwiftError Handling in Swift
Error Handling in SwiftMake School
 
Unit/Integration Testing using Spock
Unit/Integration Testing using SpockUnit/Integration Testing using Spock
Unit/Integration Testing using SpockAnuj Aneja
 
Ejercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSEEjercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSERicardoGuti50
 
Iterator Design Pattern
Iterator Design PatternIterator Design Pattern
Iterator Design PatternVarun Arora
 
SoapUI : Day18 : Webservice- Groovy in soapui : datasink
SoapUI : Day18 : Webservice- Groovy in soapui : datasinkSoapUI : Day18 : Webservice- Groovy in soapui : datasink
SoapUI : Day18 : Webservice- Groovy in soapui : datasinkTesting World
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
Quick Look for iOS
Quick Look for iOSQuick Look for iOS
Quick Look for iOSRobert Brown
 

What's hot (14)

Error Handling in Swift
Error Handling in SwiftError Handling in Swift
Error Handling in Swift
 
Unit/Integration Testing using Spock
Unit/Integration Testing using SpockUnit/Integration Testing using Spock
Unit/Integration Testing using Spock
 
Taverna tutorial
Taverna tutorialTaverna tutorial
Taverna tutorial
 
Lab 5-Android
Lab 5-AndroidLab 5-Android
Lab 5-Android
 
Servlet Filters
Servlet FiltersServlet Filters
Servlet Filters
 
Python Programming Basics
Python Programming BasicsPython Programming Basics
Python Programming Basics
 
Ext java-editor
Ext java-editorExt java-editor
Ext java-editor
 
Ejercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSEEjercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSE
 
Iterator Design Pattern
Iterator Design PatternIterator Design Pattern
Iterator Design Pattern
 
SoapUI : Day18 : Webservice- Groovy in soapui : datasink
SoapUI : Day18 : Webservice- Groovy in soapui : datasinkSoapUI : Day18 : Webservice- Groovy in soapui : datasink
SoapUI : Day18 : Webservice- Groovy in soapui : datasink
 
httpie
httpiehttpie
httpie
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
Spock
SpockSpock
Spock
 
Quick Look for iOS
Quick Look for iOSQuick Look for iOS
Quick Look for iOS
 

Similar to Qtp launch

PAGE 1Input output for a file tutorialStreams and File IOI.docx
PAGE  1Input output for a file tutorialStreams and File IOI.docxPAGE  1Input output for a file tutorialStreams and File IOI.docx
PAGE 1Input output for a file tutorialStreams and File IOI.docxalfred4lewis58146
 
Coded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual codingCoded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual codingOmer Karpas
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptxVishuSaini22
 
Automate the boring stuff with python
Automate the boring stuff with pythonAutomate the boring stuff with python
Automate the boring stuff with pythonDEEPAKSINGHBIST1
 
C++ prgms io file unit 7
C++ prgms io file unit 7C++ prgms io file unit 7
C++ prgms io file unit 7Ananda Kumar HN
 
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxModule Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxroushhsiu
 
Input output files in java
Input output files in javaInput output files in java
Input output files in javaKavitha713564
 
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxCS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxannettsparrow
 
Django is a high-level Python web framework that enables rapid development of...
Django is a high-level Python web framework that enables rapid development of...Django is a high-level Python web framework that enables rapid development of...
Django is a high-level Python web framework that enables rapid development of...ArijitDutta80
 

Similar to Qtp launch (20)

Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Keyword driven testing in qtp
Keyword driven testing in qtpKeyword driven testing in qtp
Keyword driven testing in qtp
 
UNIT 5.pptx
UNIT 5.pptxUNIT 5.pptx
UNIT 5.pptx
 
PAGE 1Input output for a file tutorialStreams and File IOI.docx
PAGE  1Input output for a file tutorialStreams and File IOI.docxPAGE  1Input output for a file tutorialStreams and File IOI.docx
PAGE 1Input output for a file tutorialStreams and File IOI.docx
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Coded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual codingCoded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual coding
 
Savitch Ch 06
Savitch Ch 06Savitch Ch 06
Savitch Ch 06
 
Savitch Ch 06
Savitch Ch 06Savitch Ch 06
Savitch Ch 06
 
Filesin c++
Filesin c++Filesin c++
Filesin c++
 
Savitch ch 06
Savitch ch 06Savitch ch 06
Savitch ch 06
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptx
 
SessionCreatorHelp
SessionCreatorHelpSessionCreatorHelp
SessionCreatorHelp
 
Automate the boring stuff with python
Automate the boring stuff with pythonAutomate the boring stuff with python
Automate the boring stuff with python
 
C++ prgms io file unit 7
C++ prgms io file unit 7C++ prgms io file unit 7
C++ prgms io file unit 7
 
Test Complete
Test CompleteTest Complete
Test Complete
 
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxModule Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
 
ExtraFileIO.pptx
ExtraFileIO.pptxExtraFileIO.pptx
ExtraFileIO.pptx
 
Input output files in java
Input output files in javaInput output files in java
Input output files in java
 
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxCS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
 
Django is a high-level Python web framework that enables rapid development of...
Django is a high-level Python web framework that enables rapid development of...Django is a high-level Python web framework that enables rapid development of...
Django is a high-level Python web framework that enables rapid development of...
 

More from G C Reddy Technologies (8)

Manual testing
Manual testingManual testing
Manual testing
 
Free Classified Ads
Free Classified AdsFree Classified Ads
Free Classified Ads
 
Load runner
Load runnerLoad runner
Load runner
 
Excel Scripting
Excel Scripting Excel Scripting
Excel Scripting
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Sql functions
Sql functionsSql functions
Sql functions
 
Qtp Resume
Qtp ResumeQtp Resume
Qtp Resume
 
Qtp Resume
Qtp ResumeQtp Resume
Qtp Resume
 

Qtp launch

  • 1. Visit: http://qtp12.blogspot.com/ Ways to launch your application Four different ways to launch your application are mentioned below: 1) SystemUtil.Run SystemUtil.Run ( FileName, Parameters, Path, Operation ) FileName - The name of the file you want to run. Parameters - If the specified FileName is an executable file, use the Parameters argument to specify any parameters to be passed to the application. Path - The default directory of the application or file. Operation - The action to be performed. If this argument is blank (""), the open operation is performed. The following operations can be specified for the operation argument of the SystemUtil.Run method: 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. 1
  • 2. Example:SystemUtil.Run "D:My MusicBreathe.mp3","","D:My Music Details","open" 2) InvokeApplication This command is now mainly used for the backward compatability ie to use with the lower versions(below QTP 6.0) of QTP. InvokeApplication("Full URL as Parameter") Example:InvokeApplication "C:Program FilesInternet ExplorerIEXPLORE.EXE http://www.yahoo.com" 3) VBscript to invoke application 1. Create a "WScript.shell" object. 2. Use the "run" object to launch the application. If the path to your executable contains spaces, use Chr(34) to ensure the path is contained within double quotes. 3. When done, set the shell object to nothing to release it. Example: Dim oShellSet oShell = CreateObject ("Wscript.shell")' Example 1 - run a batch file:oShell.run "F:jdk1.3.1demojfcSwingSet2.bat"' Example 2 - run a Java jar file:oShell.run "java -jar F:jdk1.3.1demo 2
  • 3. jfcSwingSet2SwingSet2.jar"' Example 3 - launch Internet Explorer:oShell.Run Chr(34) & "C:Program FilesInternet ExplorerIEXPLORE.EXE" & Chr(34)Set oShell = Nothing 4) Trivial but useful method If nothing works out you might try this You can use the Start -> Run dialog of Windows. 1. Add the Windows Start button to the Object Repository using the "Add Objects" button in Object Repository dialog. 2. Open the Run dialog (Start -> Run), and learn the "Open" edit field and the "OK" button into the Object Repository. 3. Switch to the Expert View, and manually add the lines to open the Run dialog. Example:Window("Window").WinButton("Button").ClickWindow("Windo w").Type("R") 4. Manually enter the lines to enter the information to launch the application, and click the "OK" button of the Run dialog. Example: Dialog("Run").WinEdit("Open:").Type "c:WINNTsystem32notepad.exe" Dialog("Run").WinButton("OK").Click 3
  • 4. If you want to keep track of further articles on QTP. I recommend you to subscribe via RSS Feed. You can also subscribe by Email and have new QTP articles sent directly to your inbox. 4