SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    FindTest Cases in a Test Set using TDAPI

    Hi all,

    Using TDAPI functions in Winrunner, can I find a TestCase ID with just the Test Case name and the TestSet information, without the Path info of the Test Case.
    ---------------------------
    Siva Kumar

  2. #2
    Junior Member
    Join Date
    Jan 2004
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    i met the similar problem - using TDAPI in Winrunner.
    I found that TDAPI can be used only in VAPI tests.
    So i found the best way to access TDAPI only via VBscript.
    Just call VBs file from TSL.
    In VBs you can do all you need(OTAG.pdf document contains examples)

    hope you understood
    Chibo

  3. #3
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    Hi Chibo,

    Thanks for your reply, You can utilize all TDAPI functions within Winrunner also.

    For eg. the following code to start with.
    ------------------------------
    load_dll (sTDClientPath & "TDClient.dll");
    reload(m_root & "\\lib\\tdapi",0,1);

    #Just make sure there is no server active anymore
    TdServerRelease();
    --------------------------------
    Once when you load the TDClient.dll and load the tdapi script found in the WR lib folder, you can utilize all the fuctions of TDAPI here.

    But my problem is... how do find the Test case id only with the following info...

    TestCase Name, TestSet Name

    Obviously i'll have all other details pertaining to Server, Login, Password, Domain and Project.

    What I will not have is the Path of the Test Case.

    The following fuctions returns the TestCase ID if we give the TestCase name along with he path.

    TDAPI_FindTestByPath(0,TestPath, TestKey);
    TDAPI_FindTestBySubjectPath(SubjectPath, TestKey);

    I need to know how to get TestCase ID without the path but I do know the TestSet name.

    Any help really means a lot.... !
    ---------------------------
    Siva Kumar

  4. #4
    Junior Member
    Join Date
    Jan 2004
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    hi, sivadreams

    yes
    i haven't found the way to solve your problem via TDAPI. But i'm sure it's possible to do it vi OTA.
    Why you don't want to use vbs? it's more flexible.

    Chibo

  5. #5
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    Hi,

    I dont mind using but I dont have access to VBS compilers on the client envrionment.
    ---------------------------
    Siva Kumar

  6. #6
    Senior Member
    Join Date
    Jan 2002
    Posts
    678
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    Originally posted by sivadreams:
    ...I dont have access to VBS compilers on the client envrionment.
    <font size="2" face="Verdana, Arial, Helvetica">Huh? VBscript is present on most windows machines. Anyway, you can do this easily in TSL. I am making the asumption you want to the id of the current test here.

    If you are using QC use:

    lngTestID = qcdb_get_test_value("TS_TEST_ID");

    If you are using TD use:

    lngTestID = tddb_get_test_value("TS_TEST_ID");

    You can also look at TDAPI_CreateTestinCycleList.

    [ 03-19-2006, 10:02 AM: Message edited by: EAS ]

  7. #7
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    Hi EAS,

    Thanks for your suggestion, but still this will not help.

    The very reason why I am looking for such a solution is...
    1. I follow a Key-Word driven Test Automation Framework. All my Test Cases are available within a Database on not in TestDirector DB.
    2. But all our Test Management happens from TestDirector.
    3. Once if the Tester creates a Test Set in Test Director, I need to pick just those TestIDs and execute them from TestCase DB.
    4. I also need to report back into TestDirector about the results.
    5. For all this i need to find the list of TestCase Ids available in a particular TestSet
    ---------------------------
    Siva Kumar

  8. #8
    Senior Member
    Join Date
    Jan 2002
    Posts
    678
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    Seems you have got yourslf into a bind. Sounds like you have some placeholder tests in TD that you want to update out of your framwork. You've already put the placeholders in test sets and you want to execute then find the test set and the placeholder test and update it. I'd recommend that you reconcile the TestID's to your framwork or db along with your test set id's. This will save you a lot of headaches. Or do not start with test sets and build them on the fly from your framwork using the tdapi functions to create test sets, add tstests to test sets and create runs for your results.

    Or, use a vbscript or vb program to batch the results to TD from your results db after the run.

    You can use the tdapi functions to do what you want, but it's not going to be a simple function. You will have to find your test set then find your test by iterating through lists.

  9. #9
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    Hi EAS,

    I have just figured out away to do it, but have a problem mid-way. Hope you are someone could help.

    The Logic goes something like this...

    Logic:
    --------------------------------------------------
    1. Initialize the TestDirector server - TdServerInitInstance()
    2. Connect to TestDirector project - TDAPI_Connect()
    3. Create list of tests in the respective test set - TDAPI_CreateTestInCycleList()
    4. Read all the TC_TEST_ID and TS_NAME - TDAPI_TestInCycleListMove(), TDAPI_GetTestValue()
    5. Loop to Step 4 until ListSize

    Once when you have TC_TEST_ID you can update !em as one want to like.
    --------------------------------------------------


    Code:
    --------------------------------------------------
    #Change this to your server and project information
    tmpServer= getvar("td_server_name");

    # Notation : SERVER as UNC like http:\\.........\wcomsrv.dll
    if (index(tmpServer,".dll")==0)
    MyServerDLL = sTD_ServerURL & "/tdbin/wcomsrv.dll";
    else
    MyServerDLL=tmpServer;

    # Notation : DOMAIN.PROJECT
    tmpProject = getvar("td_database_name");
    if (index(tmpProject,".")==0)
    MyProject = sTD_ProjectDomain & "." & sTD_Project;
    else
    MyProject=tmpProject;

    MyUser = sTD_User;
    MyPWD = sTD_Password;

    # Load the tdapi library
    m_root = getenv ("M_ROOT");
    load_dll (sTDClientPath & "TDClient.dll");
    nStatus = reload(m_root & "\\lib\\tdapi",0,1);

    #Just make sure there is no server active anymore
    TdServerRelease();

    # Initialize the TestDirector server
    if((nStatus=TdServerInitInstance("apartment", MyServerDLL )) != TDAPI_NOERROR)
    {
    report_msg("Server not initialized");
    }

    # Connect to TestDirector_Demo project
    if(TDAPI_Connect(MyProject, NULL, MyUser, MyPWD) != TDAPI_NOERROR)
    {
    TdServerRelease();
    report_msg("Not connected to project");
    }
    ################################################## ############################################
    ## Experiment Area Begins
    ################################################## ############################################

    # Create list of tests in the "TestingTestSets" test set
    nStatus = TDAPI_CreateTestInCycleList("SELECT TC_TEST_ID from TESTCYCL where TC_CYCLE = ‘TestingTestSets‘", ListSize);

    if (nStatus != TDAPI_NOERROR)
    report_msg("Error: "& nStatus &" Cannot create test in cycle list.");
    else
    report_msg("ListSize: " & ListSize);

    # Move to the first element on the list #

    nStatus = TDAPI_TestInCycleListMove(TDAPI_MOVE_FIRST, TestKey);

    if (nStatus != TDAPI_NOERROR)
    {
    report_msg("Error: Could not move to the first element on the list");
    }


    ################################################## ############################################
    ## Experiment Area Ends
    ################################################## ########################################
    #Disconnect from the repository
    TDAPI_Disconnect();

    #Release the connection to the server
    TdServerRelease();
    --------------------------------------------------

    Here is where I have a problem now!

    TDAPI_CreateTestInCycleList() returns "General Error"

    Something wrong in the SQL Query.
    nStatus = TDAPI_CreateTestInCycleList("SELECT TC_TEST_ID from TESTCYCL where TC_CYCLE = ‘TestingTestSets‘", ListSize);

    Am I doing a mistake with the Quotes ‘TestingTestSets‘

    Please help!
    ---------------------------
    Siva Kumar

  10. #10
    Senior Member
    Join Date
    Jan 2002
    Posts
    678
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: FindTest Cases in a Test Set using TDAPI

    I have just figured out away to do it,
    <font size="2" face="Verdana, Arial, Helvetica">Hmmm...wonder how that happened.


    Take another look at the manual.

    SQLString A string that contains the select SQL query statement. The select clause must include the TC_TEST_ID and TC_CYCLE fields and the from clause must include the name of the run steps table (usually the "TESTCYCL" table.)
    <font size="2" face="Verdana, Arial, Helvetica"></font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">nStatus = TDAPI_CreateTestInCycleList(&quot;SELECT TC_CYCLE, TC_TEST_ID from TESTCYCL where TC_CYCLE ='default' &quot;, &amp;ListSize);</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

 

 

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 10.71%
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:18 PM.

Copyright BetaSoft Inc.