Micro Focus QTP (UFT) Forums
how to update test status using TDConnection - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: how to update test status using TDConnection (/Thread-how-to-update-test-status-using-TDConnection)



how to update test status using TDConnection - patelpradeep - 07-16-2009

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,


RE: how to update test status using TDConnection - KVK - 07-16-2009

Hi

Try this

LastRun.Status
LastRunResults.Status


RE: how to update test status using TDConnection - patelpradeep - 07-16-2009

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.