Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can we run QTP on virtual machine at scheduled time through VB script.
#1
Solved: 11 Years, 3 Months, 2 Weeks ago Rolleyes 
Hi All,
Can any body help me!!!!

How can we run QTP on virtual machine at scheduled time through VB script only.
Its urgent.

Also how can we close QTP on any machine at particular machine through vb script

Thanks in Advance
Ritu
Reply
#2
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi,

For your second query, PsTools can be used which executes process related commands in remote machines. The same can be used along with vbscript.
Checkout the following link
http://www.myitforum.com/articles/11/view.asp?id=9956

I dont know how far the pstools work with virtual machines. Expecting some good inputs from the forum friends..

Thanks,
Reply
#3
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi

Use the below code to open qtp on other machine. Paste this code in vbs file and run it

'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


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", "<REMOTEMACHINEIP or NAME>") ' 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:\Tests\Test1", True ' Open the test in read-only mode

' set run settings for the test
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:\Tests\Test1\Res1" ' Set the results location

qtTest.Run qtResultsOpt ' Run the test

MsgBox 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


Hope it helps

- Mr.K
Reply
#4
Solved: 11 Years, 3 Months, 2 Weeks ago
Thanks Mr.K for ur gr8 reply.
This is really help full.

I have another question:
Suppose I have 2 QTP license, On one machine QTP can only run if on another machine its closed.
And I installed one license on my host machine and another on my virtual machine, Now i want to run my one set of qtp scripts on my host machine and another set of scripts on my virtual machine.

if my virtual machine is on my same host machine(on which my one set of scripts) or on another host then, HOW can I access my virtual machine to run the second set of QTP scripts. (means I guess for virtual machine ip address and machine name is not sufficent) .. m I right/1


Please reply if my question is right ?? Smile

Thanks


Thanks Mr.K for ur gr8 reply.
This is really help full.

I have another question:
Suppose I have 2 QTP license, On one machine QTP can only run if on another machine its closed.
And I installed one license on my host machine and another on my virtual machine, Now i want to run my one set of qtp scripts on my host machine and another set of scripts on my virtual machine.

if my virtual machine is on my same host machine(on which my one set of scripts) or on another host then, HOW can I access my virtual machine to run the second set of QTP scripts. (means I guess for virtual machine ip address and machine name is not sufficent) .. m I right/1


Please reply if my question is right ?? Smile

Thanks
Reply
#5
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi

Your virtual machine is separate Host Machine. Your host machine and your virtual machine will have different computer names and IP's . I am right? If this is the case then you can create QTP objects on these two machines individually and run the tests using the above code.

-Mr.K
Reply
#6
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi, Mr. K.
The QTP can run on the virtual machine using your script. However this virtual machine does not have a monitor to link to it. When we remote in and have live session, it runs at the scheduled time without problem. However, if not remote in, the QTP lanuch, but can not run any test (Test any Web UIs). (All status are "STOP").

Do we have to link a monitor to it?

Thanks
Reply
#7
Solved: 11 Years, 3 Months, 2 Weeks ago
QTP script will not run if you have not logged into the machine, You will need to login to machine and make sure the machine does not get locked in order to run your scripts properly.
Virtual machines does not really require a monitor linked to it.

Reply
#8
Solved: 11 Years, 3 Months, 2 Weeks ago
I believe the issue would be with the way you authenticate to the host machine. A RDP is a session connectivity and does not give you the real login rights.

Use VNCviewer to first authenticate a real connection and then perform a RDP.
Sorry saket...I meant to reply to the previous post for Lisa. Unfortunately clicked on your post.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#9
Solved: 11 Years, 3 Months, 2 Weeks ago
Can you give us more details on this? I am not sure about "VNCviewer". I forwarded your msg to our network admin. They are not sure what to do....

In fact, we do not want run this job in the remote session....
we set up a normal scheduled Task run as network adm. The job will trigger the vbscript to launch QTP app and run QTP tests. The job ran at the schedule time, but failed to launch QTP app. however if I remoted in to debug (using same login). no problem at all...

You said we need to login first, how to write this step in the vbscript?

By the way, when we set up the scheduled job, we already entered the network adm logins.....


Thanks for your help!
Reply
#10
Solved: 11 Years, 3 Months, 2 Weeks ago
Google for VNC and you will get all the information. Use VNC to first authenticate and then close it.

Your first script should authenticate all the host machines you have and open a RDP connection to them. They need to be highlighted. QTP cannot run in LOCKED mode.
You can use VNCviewer to open a remote session to your host machine. IF you do not want a remote at all then i guess as far as my knowledge it is not possible to execute.

I also suggest you approach HP support to see if they have a alternate.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Loading QRS files at Run time dvkbabu 2 10,018 03-24-2017, 09:04 PM
Last Post: UrmilaSaha
  Running UFT scripts on a remote machine with no UFT installed on the Remote machine anupam4j 0 3,032 01-21-2016, 06:48 PM
Last Post: anupam4j
  Missing Resources, Information Pane, Debug Viewer, Run time Data Table not visible Aurodeepta 3 6,975 05-28-2015, 02:52 PM
Last Post: Aurodeepta
  Object Identification not working on Run Time Ajatshatru 2 3,261 05-06-2015, 07:27 PM
Last Post: Ajatshatru
  Error while adding Object to Object repository at run time SaranKumarV 3 8,644 02-02-2015, 01:40 AM
Last Post: dubeyvin

Forum Jump:


Users browsing this thread: 4 Guest(s)