SPONSORS:






User Tag List

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

    Help needed in executing the test cases using Excel-VBA

    Hello Everyone,
    Greetings!

    I am developing the tool QC Test case updater and i have this code below which Executes Run Status, Step Status but it is not updating the Test Status.

    Below is the code i have used, i am getting the error in the line (tstInstance.Status = "Failed") i have highlight it below in the code. can someone verify my code and advice me what is wrong in this or any additional snippet do i need to add?


    Dim intTestID, FldPath, TestSetName, i
    Dim TestSetFact, tsTreeMgr, tSetFolder, TestSetsList, theTestSet
    Dim TestSetIdentifier, TSTestFact, TestSetTestsList, testInstanceF, aFilter
    Dim lst, tstInstance

    intTestID = "8968"

    FldPath = TextBox3.Text '"Root\ProjFold\Release1\BRD"
    TestSetName = ComboBox3.Text '"BRD" '

    Set Connection = CreateObject("TDApiOle80.TDConnection")
    Connection.InitConnectionEx Sheet2.Range("B1").Value2
    Connection.Login TextBox1.Text, TextBox2.Text
    Connection.Connect ComboBox1.Text, ComboBox2.Text

    Set TestSetFact = Connection.TestSetFactory
    Set tsTreeMgr = Connection.TestSetTreeManager

    Set tSetFolder = tsTreeMgr.NodeByPath(FldPath)
    Set TestSetsList = tSetFolder.FindTestSets(TestSetName)
    Set theTestSet = TestSetsList.Item(1)
    TestSetIdentifier = theTestSet.ID
    i = 0
    Set TSTestFact = theTestSet.TSTestFactory
    Set TestSetTestsList = TSTestFact.NewList("")

    Set testInstanceF = Connection.TSTestFactory
    Set aFilter = testInstanceF.Filter

    aFilter.Filter("TC_TEST_ID") = intTestID
    Set lst = testInstanceF.NewList(aFilter.Text)
    Set tstInstance = lst.Item(1)
    MsgBox (tstInstance.Field("TS_Name"))
    'tstInstance.Status = "Failed"
    'tstInstance.Field("TC_STATUS") = Item1.Status '"Passed"
    'tstInstance.Post
    Dim RunF, runName, NewRun, runStepF, runlst, Item1, runStep2

    MsgBox (tstInstance.Field("TS_Subject"))
    Set RunF = tstInstance.RunFactory
    runName = "Run_" & Month(Date) & "-" & Day(Date) & "_" & Hour(Now) & "-" & Minute(Now) & "-" & Second(Now)
    Set NewRun = RunF.AddItem(Null)
    NewRun.Status = "Passed"
    NewRun.Name = runName
    NewRun.Post
    NewRun.CopyDesignSteps
    NewRun.Post
    Set runStepF = NewRun.StepFactory
    Set runlst = runStepF.NewList("")
    For Each Item1 In runlst
    Set runStep2 = Item1
    runStep2.Status = "Passed" '
    runStep2.Field("ST_ACTUAL") = "As Expected"
    runStep2.Post
    Next
    'tstInstance.Refresh
    tstInstance.Status = "Failed" '<-------I am getting error in this line.
    'The Error Description was
    'Run-time error '-2147220204 (80040514)'
    'You do not have required Permission to execute this action"

    tstInstance.Post
    Connection.DisconnectProject
    Connection.ReleaseConnection
    'Set QC = Nothing
    Set Connection = Nothing
    Attached Images Attached Images

  2. #2
    Advanced Member
    Join Date
    Apr 2005
    Location
    Maryland
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Off the top of my head looks like your not refrecing the status filed correctly, should be something like : field("TS_EXEC_STATUS")
    Alfredo R. Rivera
    IT Principal SDLC Automation Subject Matter Expert
    (CCRC/CQ/CQTM/RMT/RFT/RPT/REQPRO)
    (LR/QTP/CQ/SS/WR)
    Certified Mercury Interactive Instructor
    Certified Tester, Foundation Level (CTFL)
    www.fredotech.com
    www.testingframework.com
    www.automationtesting.org
    http://www.linkedin.com/in/fredotech

 

 

Tags for this Thread

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 12.50%
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:24 AM.

Copyright BetaSoft Inc.