SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Sep 2007
    Location
    Australia
    Posts
    367
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    running qtp in batch with test params

    Below is the code i have been using to run qtp but now I want to enter test params. I have found code that does this in another .vbs script but I'm not sure how to incorporater into this one...
    I'd appreciate the help
    OTHER CODE::
    Set params = test.ParameterDefinitions.GetParameters()

    parameter1 = "par1"
    parameter2 = "par2"

    params.Item(par1).Value = "This is my first parameter"
    params.Item(par2).Value = "This is my second parameter"
    END OTHER CODE::


    Option Explicit
    Dim StrCmd,Path
    Path = "C:\Program Files (x86)\HP\Unified Functional Testing\bin"
    StrCmd = "CD /D "& Path & "& Start mdrv.exe -usr "& DblQuote("C:\Unified Functional Testing\UFTSW\UFTSW.usr") &""
    Call Run(StrCmd,1,False) 'Showing the console
    Call Run(StrCmd,0,False) 'Hiding the console
    '************************************************* *********************************************
    Function Run(StrCmd,Console,bWaitOnReturn)
    Dim ws,MyCmd,Result
    Set ws = CreateObject("wscript.Shell")
    'A value of 0 to hide the MS-DOS console
    If Console = 0 Then
    MyCmd = "CMD /C " & StrCmd & ""
    Result = ws.run(MyCmd,Console,bWaitOnReturn)
    If Result = 0 Then
    'MsgBox "Success"
    Else
    MsgBox "An unknown error has occurred!",16,"An unknown error has occurred!"
    End If
    End If
    'A value of 1 to show the MS-DOS console
    If Console = 1 Then
    MyCmd = "CMD /K " & StrCmd & ""
    Result = ws.run(MyCmd,Console,bWaitOnReturn)
    If Result = 0 Then
    'MsgBox "Success"
    Else
    MsgBox "An unknown error has occurred!",16,"An unknown error has occurred!"
    End If
    End If
    Run = Result
    End Function
    '************************************************* *********************************************
    Function DblQuote(Str)
    DblQuote = Chr(34) & Str & Chr(34)
    End Function
    '************************************************* *********************************************

  2. #2
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Location
    Kew Gardens, United States
    Posts
    2,712
    Post Thanks / Like
    Blog Entries
    1
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    I am not understanding into where you wish to pass the parameters.
    Please describe a little bit more for us.
    Thanks,
    Kevin
    When in Florida, Don't Tampa with the code. I made this up.

  3. #3
    Member
    Join Date
    Sep 2007
    Location
    Australia
    Posts
    367
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Quote Originally Posted by bklabel1 View Post
    I am not understanding into where you wish to pass the parameters.
    Please describe a little bit more for us.
    Thanks,
    Kevin
    Essentially I am interested in the 2 types of parameters Test and Action. In the above code I don't know where to put the Test Parameter code so that the UFT script can access it.

    Also, don't know how to code the UFT script receiving the parameter so that it accepts it

    I don't use parameters very much

    I'm ok with action params.

    Joe

  4. #4
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Location
    Kew Gardens, United States
    Posts
    2,712
    Post Thanks / Like
    Blog Entries
    1
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    I associate the Test Parameters in two places. I don't have UFT in front of me. I hope someone else joins this thread to fill in the details.
    1) in an OTA .vbs script you can create the QTP and Test Objects. Then you can send and receive parameters with scripts to the .vbs script.
    2)There is a word similar to Environment(""). I cannot think of it off hand but it lets you pass parameters between test scripts.

    Are you talking about any of this?

    Thanks,

    Kevin
    When in Florida, Don't Tampa with the code. I made this up.

  5. #5
    Member
    Join Date
    Sep 2007
    Location
    Australia
    Posts
    367
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    yes all of them

  6. #6
    Member
    Join Date
    Sep 2007
    Location
    Australia
    Posts
    367
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    ok lets start by running UFT on Command line using a .vbs script that passes a param to the executed test - is there a sample .vbs script that anyone has?

 

 

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.36 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 13.64%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (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 10:37 PM.

Copyright BetaSoft Inc.