SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Question on database access in vTest

    Hello.
    I am evaluating a testing tool for my company called Verisium vTest and am creating a script within vTest that logs into our application. That part of the script works OK. I would now like to write JavaScript code to query an Oracle database within the script. How do I go about doing that?

    Thanks for any help.
    -Melissa

  2. #2
    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: Question on database access in vTest

    It sounded like you just need to figure out the JavaScript required to query a database. I've moved your post here to the Scripting forum for more scripting help.
    Joe Strazzere
    Visit my website: AllThingsQuality.com to learn more about quality, testing, and QA!

  3. #3
    Junior Member
    Join Date
    May 2006
    Location
    California, USA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Question on database access in vTest

    Hi Melissa,
    If you simply wish to verify the values inside the database you can use a Database Checkpoint. That does not require any kind of scripting and can be done using simple GUI based point and click operations.

    If you are trying to do something else, the following JavaScript could form the basis of your code.

    // Connect to an ODBC database with ODBC DSN = mydb
    var db = DbConnect("myuser", "mypassword", "mydb");
    // Execute a query
    var stmt = DbExecute(db, "select * from mytable");
    // Loop as long as you obtain data
    while (true)
    {
    var ret = DbFetch(stmt);
    if (ret != 0)
    break;
    // Fetch the 2nd column from the query
    var buffer = DbGetValue(stmt, 2);
    // Print the result for debugging
    UtilPrintString(buffer + "\r\n");
    }
    DbFreeResult(stmt);
    DbDisconnect(db);

    Please let me know if you have any other questions.
    -Kevin Cross
    Director of Sales & Support
    Verisium, Inc.
    Functional Testing & Load Testing Products

 

 

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 11.54%
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 04:06 AM.

Copyright BetaSoft Inc.