Forum Stats

  • 3,874,422 Users
  • 2,266,733 Discussions
  • 7,911,843 Comments

Discussions

Manage Variables keeps entering recorded username when playing back Script

694235
694235 Member Posts: 16
edited Jun 3, 2009 11:54AM in QA/Testing
Hi all,

I have been trying to get this to work for a while now.
Basically I am doing a test on a web registration form page. So I need to create a script which uses a dynamic value for the username so I dont get a 'username taken error' when running it.

I have right clicked on the page in test suite and gone into Manage Variables.
I have found the username parameter and 'mapped it to expression'
Then the expression I am using is "testuser0111" & IterationCount().
When evaluated the evaluated expression is testuser01110, which is sweet.
So it looks like everything should work when I run it, but when I run the script though e-tester it still keeps putting my recorded value into the form which is (testuser0101).

Grrrr, Computer 1 Paul 0. Please help me win this :)


Thanks guys
-Paul

Answers

  • Alex
    Alex Member Posts: 799
    Hi Paul

    If i remember correctly there is a bug in eTester in which if you do not create a databank file and iterate with a databank the internal variables will not work, the work around is to create a fake databank.

    Edit -> Databank Wizard -> Add Variable -> enter Blah as a Name -> life type as external -> Select Auto-Bind and Click OK

    Now you should have a new variable called blah which we will not use, however that is going to allow us to select Iterate and select play back with databank

    Hope this helps

    Alex
  • 694235
    694235 Member Posts: 16
    Thanks Alex, when I try to Auto Bind, it says
    Enter Name for auto-generated csv file.
    If if enter a name then click ok it is saying
    AutoBing Operation Failed: Unable ot open <noname> output file.

    ?? anyone seen this?
  • Alex
    Alex Member Posts: 799
    Paul

    Do you have a databank file with the same name of the script ? try going to the data binding tab select clear and try the same process again.

    Works well for me.

    Regards

    Alex
  • 694235
    694235 Member Posts: 16
    It's not working Alex, I am struggling to create a data bank... is there any info on that. I wonder if my workspace is causing the problem.
    When I go to autobind it still says autobind operation Failed: unable to open <noname> output file
  • 694235
    694235 Member Posts: 16
    hah ah silly - it was trying to create a databank... but there was no databank folder. I have created a databank folder... and it has autobinded successfully. Thanks I will update if this works.
  • 694235
    694235 Member Posts: 16
    Yes! Looks like it is working, but it is not remembering the last username used, so it runs the script again with the same iteration (where the username is already taken now).

    Any ides where I can set it so that it remembers what it tried on the last run and increments to next iteration?

    Computer 2 Paul 1

    Thanks guys
    -Paul
  • Alex
    Alex Member Posts: 799
    Hi Paul

    if you do not need to know the name that you are using, you can use a timestamp e.g "User"&Now()*86400 that will generate a unique user for each iteration.

    If you need to know the user and you are not using 8.50 (does not have VBA) you can always create a text file and write the new username to that file using VBA.

    Regards

    Alex
  • 694235
    694235 Member Posts: 16
    Excellent - Yeap that works. I don't need to know the user I just need to make sure it is unique. Can you explain "Now()*86400. Wondering where I can find more exp like this.
    Thanks

    Computer pwned Paul Wins!
  • IHodgetts
    IHodgetts Member Posts: 264
    edited Jun 3, 2009 10:09AM
    Now() gives the current date/time
    *86400 converts this figure to number of seconds AKA "UNIX date/time" (or "number of seconds since midnight 01/01/1970")

    Also useful are Date() and Time() which can be useful if the fields you are working with are too small to hold the full date & time value.

    Edited by: IHodgetts on Jun 3, 2009 3:09 PM
  • 694235
    694235 Member Posts: 16
    Thanks for all your help guys
This discussion has been closed.