0

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

Thanks, Ramya.

  • 1
    Whilst I don't want to second guess your reasons, could you please tell us why you don't want to use ActiveXObject? (just curious) – Xiaofu Aug 18 '09 at 06:45

3 Answers3

0

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
  • 249
  • 1
  • 4
  • 9
  • or you can use vbScript in addition for that. – Mannusanghi Aug 18 '09 at 05:32
  • 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. –  Aug 18 '09 at 06:39
0

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
  • 110,860
  • 49
  • 189
  • 262
0

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
  • 15,523
  • 2
  • 32
  • 45
  • 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. –  Aug 18 '09 at 07:19