SPONSORS:






User Tag List

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

    Passing Array from QTP to called Winrunner test

    Hi,
    I am trying to pass an array of data to a winrunner test from QTP. It gives me an error saying Scalar quantity passed instead of array. Is it possible to pass arrays from QTP to Winrunner tests and to other QTP actions?


    Dim Arr(3)
    Arr(0) = "Test"
    Arr(1) ="Test1"
    Arr(2) = "Test2"
    TSLTest.RunTestEx "S:\NEW\Projects\E7025\09 Test\14 Automation Pilot\QTP_WR_POC",TRUE,FALSE, "Esalesqc", "testqc", "01202000001",Arr


    the above code throws an error also the number 01202000001 gets truncated to 1202000001 in winrunner

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

    Re: Passing Array from QTP to called Winrunner test

    Oh my, working with WinRunner, huh? I would rather lay blacktop in Bakersfield, CA in August.

    I would probably try to get passing a simple variable, say an integer, working first. Then step up to the Array. I don't have documentation on WR automation, but I would look carefully at that to see if you have to format complex data types in some special way when passing between vbScript and that positively brain-dead TSL (the automation interface should make that transparent, but we are talking WinRunner here).

  3. #3
    Junior Member
    Join Date
    Sep 2005
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing Array from QTP to called Winrunner test

    Hi Terry,
    I have already been able to pass string variables and that is working. It's just the numbers and arrays that are giving problems.
    I did check the QTP help file where it mentions that strings can be passed to Winrunner as parameters. So i guess that means array passing is ruled out. The work around i have come up is to concatenate all the strings in the array in QTP and then pass it to Winrunner. In winrunner i am using the split function to retrieve the array. This works perfectly(or atleast as of now it seems perfect).

    Thanks.

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

    Re: Passing Array from QTP to called Winrunner tes

    I am not surprised you are limited to this approach (nice workaround by the way), given the age of WR. When I worked with it, in '99 and '00 (version 5 or 6) I do not remember it supported a COM automation interface.

    But it sounds like you can do what you need to get done. Hopefully you will not need to interface between the two worlds very often, or if you do, hopefully this can be in a simple and standard way.

    -Best of luck, Terry

  5. #5
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Passing Array from QTP to called Winrunner tes

    Why dont you use the below technique

    Dim Arr(3)
    Arr(0) = "Test"
    Arr(1) ="Test1"
    Arr(2) = "Test2"

    arrString=Join(Arr,";")

    TSLTest.RunTestEx "S:\NEW\Projects\E7025\09 Test\14 Automation Pilot\QTP_WR_POC",TRUE,FALSE, "Esalesqc", "testqc", "01202000001",ArrString

    I know it will require you to modify the WinRunner code to use a split inside but....

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

    Re: Passing Array from QTP to called Winrunner tes

    I think that is what he said he is doing.

 

 

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 © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:26 PM.

Copyright BetaSoft Inc.