SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Feb 2000
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help? Basic data driven testcase trouble

    Hi, I'm an extreme newbie to Silk Test and I am having some trouble creating a basic data driven test. I used an example in help as a template, but I get an error "Variable Data is not defined" here is a snipet of the code
    _________________________________________
    [-] type USERDATA is record
    .........[ ] STRING sLoginEmail
    .........[ ] STRING sPassword
    .........[ ] STRING sHint
    .........[ ] STRING sFirstName
    .........[ ] STRING sLastName
    .........[ ] STRING sFirstAddress
    .........[ ] STRING sSecondAddress
    .........[ ] STRING sCity
    .........[ ] STRING sState
    .........[ ] STRING sZipcode
    .........[ ] STRING sCreditCardType
    .........[ ] STRING sCreditCardNumber
    .........[ ] STRING sCreditCardExpireMonth
    .........[-] STRING sCreditCardExpireYear
    .[-] main ()
    .........[ ] USERDATA Data***
    .........[-] LIST OF USERDATA lsData = {...}
    ...............{"x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "x"}
    .........[-] for each Data in lsData <-----ERROR here
    ..............[ ] CreateNewUser (Data)
    .[+] testcase CreateNewUser (USERDATA Data)

    _______________________________________

    Now since this is only the second script I have made in Silk I am totally at a loss as to why "[-] for each Data in lsData " has an error because I swiped it straight from help under the topic "Passing data to a testcase" Can anyone help me?

    Also, I struggled with an error for 2 hours that turned out to be a " " at the end of a line...so you can imagine where my head is

    Thanks in advance
    Eric



    [This message has been edited by Erichs (edited 02-14-2000).]

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help? Basic data driven testcase trouble

    Your example works for me. The only way I can cause your error is to comment the USERDATA Date line.

    Try deleting the two 'blank' characters from the end of your "USERDATA Data " line and see if that helps. (You can 'expose' them in your example here by blocking the section with the mouse.)

    Otherwise you might temporarily relocate this line to be a global variable either above Main() or below the testcase using the Alt and Arrow keys. If the problem follows it, delete the entire line and re-enter it.

    FWIW, Visual 4Test is a little quirky when it comes to pasted code examples. Apparently it diffrentiates between a CR/LF and just a LF. This can results in a red "X" in the left column. The cure is to delete the last character in the previous line and then press the Enter key.

  3. #3
    Junior Member
    Join Date
    Feb 2000
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help? Basic data driven testcase trouble

    [QUOTE]Originally posted by John J. Miller:


    Try deleting the two 'blank' characters from the end of your "USERDATA Data " line and see if that helps. (You can 'expose' them in your example here by blocking the section with the mouse.)


    Thanks, I'm a little redfaced for making the same mistake (?) twice, but removing those spaces made the difference. This error only happened at compile and did not show a red X.

    Thanks for the pasting tip

    Eric


  4. #4
    Junior Member
    Join Date
    Apr 2002
    Location
    Boston, MA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help? Basic data driven testcase trouble

    I am where you are when you began with silktest. I am puzzled. I want to record a script that I can run for different account numbers and each account number will have different views. eg. 1222223 have access to other accts. I am not sure if I am clear. Need help?

    ------------------

  5. #5
    Senior Member
    Join Date
    Jan 2002
    Location
    Des Moines, Iowa
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help? Basic data driven testcase trouble

    In answer to how to data drive your script. The basic way would be to change your script from something like this...

    window.object.SetText("123456")

    to

    string sAStringVariable
    window.object.SetText(sAStringVariable)

    In most places where you see a hardcoded value as an arguement to a method you can replace that value with a variable.

    The variable will contain the value "123456"
    or any thing else you decide to put in there.

    As far as where to get the data from, there are lots of ways to do this. Really depends on what you need to do and how you envision adding or changing data for your script. You can use the testdata: in the pln file if you are using that piece. You could place the data in a method you create for the object. You could drive the data from a text file. Or an ODBC connection to a Excel file, if we are going there, you could even use Access to store data for your testscripts (My personal favorate). There is even the AUT's own database that can provide the script with data.

    From there Silktests help would be very accomidating in telling you how to write code to get to the data in what ever format you picked.


    ------------------

  6. #6
    Junior Member
    Join Date
    Apr 2002
    Location
    Boston, MA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help? Basic data driven testcase trouble

    Thanks. I will try your suggestion. Thanks a lot.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 12:37 PM.

Copyright BetaSoft Inc.