Micro Focus QTP (UFT) Forums

Full Version: how to update test status using TDConnection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,

i have added one extra field into Test Status list for user environment errors "ENVERR" using project settings.
I m writing VAPI scripts for automation using vbscript.

If the automation tests has any test environment error i want to set the Status to ENVERR.

I am using this code to set the value but it has no effect, the run automatically sets the value to either Failed or Passed only.

----------------------------------------
Code:
Set com = TDConnection.Command
  com.commandText="update testcycl set TC_STATUS='"& "ENVERR" &"' where TC_CYCLE_ID ="& CurrentTestSet.Id & " AND TC_TEST_ID="& ThisTest.Id
com.execute
--------------------------------------

i also tried setting the status with these commands but no success.
Code:
CurrentRun.Status = "No Run"
   CurrentTest.Status = "No Run"

Can someone please guide me?

Thank you,
Hi

Try this

LastRun.Status
LastRunResults.Status
thanks for you reply.
i tried the both members but it didnt work. I am getting error as "Object required"

it seems there is to QC variable as LastRun & LastRunResults.