SPONSORS:






User Tag List

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

    QTP Script question

    The software i'm using is QTP, but i guess this would apply to any testing package.

    I need to create a script to test for user creation. I assembled a script that creates a user as part of the test, and at the end it deletes the user as part of cleanup.

    The issue is that our application only logically deletes users, it doesn't physically deletes them, and they are unique, so the next time the script runs it fails because that user already exists.

    Does anybody know a solution for this?? Can i make a script in QTP that physically chooses a different username each time the scripts runs? or any other ideas??

  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: QTP Script question

    Use a function to create random characters for the user name.
    You can buy my Art from: "Post Cards now available"
    Ian Fraser Landscape Photography
    World Wide Shipping.

    http://mowogman.wordpress.com/

  3. #3
    Moderator Joe Strazzere's Avatar
    Join Date
    May 2000
    Location
    USA
    Posts
    13,170
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: QTP Script question

    [ QUOTE ]
    Does anybody know a solution for this?? Can i make a script in QTP that physically chooses a different username each time the scripts runs?

    [/ QUOTE ]

    Certainly. Most tools can choose different values each time (either from a list of usernames, or using randomized strings).
    Joe Strazzere
    Visit my website: AllThingsQuality.com to learn more about quality, testing, and QA!

  4. #4
    Super Member Jonty's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    1,266
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP Script question

    As Ian says use a random algorithm to generate unique values.

    Store the previously used values in some file and compare your current data with the repository first before submitting.

    The application would store in the physical data in some repository, so validate against that before creating a new one.
    Cheers
    Jonty..
    -- Here to Learn and share ---

  5. #5
    Junior Member
    Join Date
    Apr 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP Script question

    Thank you all. I followed Joe's hint. I basically created a data table with a list of usernames. My script goes to that table and picks the first one on the list, during script.

    At the end of my script, i make a call to a different action that actually opens the table in excel and deletes the first row, so that username is not available any longer.

    There is a way to delete the row right from QTP but i wasn't sure how to do that...but this works.

  6. #6
    Member
    Join Date
    Jun 2005
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP Script question

    If you're using excel, you could format the cell to append the Date/Time to the end of a username. This will be unique every time and you won't have to delete the row from excel and constantly have to mess around with your spreadsheet.

  7. #7
    Junior Member
    Join Date
    Apr 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP Script question

    Thats a great idea. I dont think it will work, because this data table is actually managed by QTP, i only use excel at the end of the script to delete the username. Excel is not used when the script runs..

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

    Re: QTP Script question

    I have a follow up question. When my script ends, it loops back to the beginning and tries to run the script again, using the second username on the datatable. It seems it will run through all the usernames in a loop.

    I dont want this, i want it to use one username and stop at the end. How can i make it NOT LOOP. I went to Action Call Settings - Data Table Iterations, and selected " Run from Row 1 to Row 1 ", but it still loops back to the beginning running the script again using Row 2 of my username data table. Any ideas??

  9. #9
    Senior Member
    Join Date
    Mar 2010
    Posts
    118
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP Script question

    This should not happen.

    However,an alternative is to control execution thru flags in your input sheet.

    Put a column "ExecuteThis" and set it to YES or NO.

    in your script you can write logic to process the row only if the value of "ExecuteThis" is set to YES
    Cheers!!!
    Shrikant

  10. #10
    Junior Member
    Join Date
    Feb 2010
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP Script question

    As Shrikant said, with those Run Settings, it should not execute for all rows, unless there is a loop in your code.

    But still i have one question.
    If i understand it correctly, we need a unique username each time. (Please correct me if i am wrong)

    So as gadom mentioned above, if append date & time each time to common string say "UserName" then each time you execute script, it will take unique name.

    So there is no need for using DataTable here.

    With Regards,
    Kumar G.
    With Regards,
    KumarG

 

 
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.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.82%
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:23 AM.

Copyright BetaSoft Inc.