Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Test results will return exit codes
#9
Solved: 11 Years, 4 Months ago
Now i am not using loop but still getting "Type mismatch: 'environment'" error. I am pasting the entire code. please check.

Code:
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = False ' Make the QuickTest application visible

qtApp.Open "D:\PrototypeTestCases\QTPProjects\Demo\App1", True 'Open the test in read-only mode

'set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run

set fso=createobject("excel.application")
Set wb=fso.workbooks.open("D:\PrototypeTestCases\QTPProjects\Demo\App6\ResultCodes.xls")
Set sh=wb.worksheets(1)

'i is iteration value in your loop
sh.cells(1,1)=environment("TestName")
retValue=qtTest.LastRunResults.Status

Select case retValue
case "Passed":sh.cells(1,2)=1
case "Failed":sh.cells(2,2)=0.
'.
'.
'so on
End select

wb.save

wb.close
Set sh=nothing
Set wb=nothing
Set fso=nothing

WScript.StdOut.Write "Test status: " + qtTest.LastRunResults.Status + vbCr 'Check the results of the test run
qtTest.Close 'Close the test
qtApp.Quit 'Close the QTP'
Reply


Messages In This Thread
RE: QTP Test results will return exit codes - by asrivastava - 07-07-2011, 07:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Code to run all QTP scripts and see all results Pkapoor 11 17,852 08-15-2017, 02:58 AM
Last Post: Ravi
  To send the QTP Results to mail using Thunderbird Naresh 0 2,406 04-03-2015, 03:19 PM
Last Post: Naresh
  Error while opening test run results vkalyankar 3 4,318 11-12-2014, 09:49 AM
Last Post: vinod123
  Function return value is not passed during the 3rd iteration premanand1979 0 2,260 10-16-2014, 09:40 PM
Last Post: premanand1979
  How to send QTP status results to mobile Naresh 0 3,026 09-02-2014, 03:50 PM
Last Post: Naresh

Forum Jump:


Users browsing this thread: 1 Guest(s)