SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Junior Member
    Join Date
    Apr 2007
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Can we run any script as exe without opening Qtp

    Hi all

    Kindly let me know whether we can run any of the script as exe from anywhere may be from the run command or desktop.
    Actually there is script to get the daily report, so I am looking for the help that I can easily run the script (by creating exe) without opening Qtp.

    Hope will get the answer soon.

  2. #2
    Moderator ifraser's Avatar
    Join Date
    Jul 2004
    Location
    Brisbane, Australia
    Posts
    2,090
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Qtp

    No you cant
    You can buy my Art from: "Post Cards now available"
    Ian Fraser Landscape Photography
    World Wide Shipping.

    http://mowogman.wordpress.com/

  3. #3
    Junior Member
    Join Date
    Oct 2007
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Qtp

    yes u can......hope u r familier with invoking QTP through VBS.........if that is done, convert the vbs into exe

  4. #4
    Member graemeal's Avatar
    Join Date
    Nov 2005
    Location
    Belfast
    Posts
    326
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Q

    Look at the Automation Object Model as this allows you to create a single vbs file that can open QTP and run all your tests. You still need a copy of QTP though.
    Graeme

  5. #5
    Member
    Join Date
    Jun 2007
    Location
    Bavaria
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Q

    Here is the often cited code:
    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

    If Not qtApp.Launched Then
    qtApp.Launch
    End If
    qtApp.Visible = True ' Make the QuickTest application visible
    qtApp.Open "C:\<path>\<testname>" ' Open the test
    qtApp.Test.Run
    Set qtApp = Nothing ' Release the Application object

    Then just open the vbs file within IE and QTP will be started. You can run many tests within one vbs-file: Just open and run one test after the other.

    Greetings
    Dirk

  6. #6
    Junior Member
    Join Date
    Apr 2007
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Q

    Hi Sir

    I have executed the below code and my all windows got closed. System got hanged. Please tell me the another way to run .vbs from the command prompt.

    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

    If Not qtApp.Launched Then
    qtApp.Launch
    End If
    qtApp.Visible = True ' Make the QuickTest application visible
    qtApp.Open "C:\<path>\<testname>" ' Open the test
    qtApp.Test.Run
    Set qtApp = Nothing ' Release the Application object

  7. #7
    Senior Member
    Join Date
    Feb 2007
    Location
    Pittsburgh, USA
    Posts
    429
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Q

    Check this
    -Reddy

  8. #8
    Member
    Join Date
    Jun 2007
    Location
    Bavaria
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Q

    The above code is more secure but even if you entered my original code without substituting <path><testname> your system should not crash! I have just tried it!
    Do you use QTP V9.2?

    regards
    Dirk

  9. #9
    Junior Member
    Join Date
    Apr 2007
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Q

    Hi All

    kindly clear the query written next to the code below



    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
    Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
    Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable

    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
    qtApp.Launch ' Start QuickTest
    qtApp.Visible = True ' Make the QuickTest application visible
    ' Set QuickTest run options
    qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
    qtApp.Options.Run.RunMode = "Fast"
    qtApp.Open "C:\ Your Test Path Here", True ' Open the test in read-only mode <font color="red"> </font> which file should i use here? Whether the .usr (or) .vbs

    ' set run settings for the test
    Set qtTest = qtApp.Test
    qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
    Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
    qtResultsOpt.ResultsLocation = "C:\Your Results Path Here" ' Set the results location
    qtTest.Run ' Run the test
    'qtTest.Close ' Close the test
    Set qtResultsOpt = Nothing ' Release the Run Results Options object
    Set qtTest = Nothing ' Release the Test object
    Set qtApp = Nothing ' Release the Application object

    <font color="blue"> </font>

    Thanks &amp; regards

  10. #10
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,730
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can we run any script as exe without opening Q

    What do you mean "clear the query"?

    It seems your original question was whether a QTP script could be converted to an EXE file for execution standalone without using QTP itself. It that was and still is the question the answer is no, which is the first reply given. This thread then vectored off into a discussion about how QTP can be launched from a *.vbs script. That is shown in your last post, and if you need to understand what is going on with each line of this code, please read the manual or consider taking a QTP training class.

    -Terry Horwath

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.82%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:06 AM.

Copyright BetaSoft Inc.