views:

520

answers:

3

i need to invoke QTP from a javascript without using ActiveXObject. can anybody guide me how to proceed with this?

Thanks, Ramya.

A: 

Hi.. Java Script programming cannot be done in QTP but it will support Java script. We can make a DLL by using Java script and add that to QTP and there after you can use that.

Regards, Mannusanghi

Mannusanghi
or you can use vbScript in addition for that.
Mannusanghi
i need javascript to automate QTP only not for writing scripts in QTP.i need to just open QTP and run test suites in it. i have this script like this.. var qtApp = new ActiveXObject("QuickTest.Application"); // Create the application object qtApp.Launch(); // Start QuickTest qtApp.Visible = true // Make it visible But i dont want to use that ActiveXObject. Please guide me.Thanks,Ramya.
A: 

QTP supplies a COM interface for automation, in order to create the automation object you need to use ActiveXObject (see this article on using OLE Automation in Javascript).

Why do you want to avoid using ActiveXObject?

Motti
A: 

Any particular reason why you don't want to use the ActiveXObject?

Anyhow, if you're running JavaScript through the Windows Script Host, instead of the way mentioned in the manual:

var qtApp = new ActiveXObject("QuickTest.Application");

...you can do this:

var qtApp = WScript.CreateObject("QuickTest.Application"); 
qtApp.Launch(); 
qtApp.Visible = true;

But you be might using ActiveX behind the scenes there anyway, I'm not entirely sure.

Xiaofu
Thank you so much. i read about the disadvantages of ActiveX like Security model and browser dependence. so i just wanted to avoid using it.