Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URGENT: ActiveX component can't create object
#1
Not Solved Exclamation 

I created a test in QTProff and then tried to run the test from the command prompt through this script.

I fired the commands from C prompt:
1) cscript //nologo C:\Daily_Status_Checkout\Daily_Checkout.vbs

Where C:\Daily_Status_Checkout is my QTP script test location and Daily_Checkout.vbs is the script mentioned below.

Gave below mentioned error -
C:\Daily_Status_Checkout\Daily_Checkout.vbs(5, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'QuickTest.Application'

2) wscript C:\Daily_Status_Checkout\Daily_Checkout.vbs

Gave the attached error in a picture file.

C:\Daily_Status_Checkout\Daily_Checkout.vbs file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 = True ' Make the QuickTest application visible

' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"

qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open "C:\Daily_Status_Checkout", True ' Open the test in read-only mode

' set run settings for the test
Code:
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs

Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Daily_Status_Checkout\DSCRes1" ' Set the results location
qtTest.Run qtResultsOpt ' Run the test

WScript.StdOut.Write "Status is :" & qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test

Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please help me in running this automatically. I have tried adding some snippets as well to the script as shown below to kill any running session of QTProff.

Code:
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "'QTPro.exe'"

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next

which also gave me the same error, asserting the fact that this was not the issue. So someone please guide me.


Attached Files Image(s)
   
Reply


Messages In This Thread
URGENT: ActiveX component can't create object - by citibank_ani - 08-03-2010, 01:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ActiveX component can't create object: 'JavaWindow' JayeshK 0 1,489 01-07-2021, 01:12 PM
Last Post: JayeshK
  Create Terminal as object dapeamel 0 2,976 02-16-2018, 07:09 PM
Last Post: dapeamel
  How to create an object for all actions excellentpawan123 1 2,614 06-05-2014, 01:50 PM
Last Post: Jay
  Issue related to dropdown selection(Please help urgent) excellentpawan123 2 4,060 05-31-2014, 12:00 PM
Last Post: excellentpawan123
  External component has thrown an exception. mharps 1 6,961 05-28-2014, 10:07 AM
Last Post: mharps

Forum Jump:


Users browsing this thread: 1 Guest(s)