Monday 28 May, 2007

Computer Resolution

This function is used to get computer resolution

Public Function get_res()
Set progman = Description.Create
progman("Object Class").Value = "Progman"
progman("Text").Value = "Program Manager"
get_res = Window(progman).GetROProperty ("width") & "*" & Window(progman). GetROProperty ("height")
Msgbox ""&get_res
End Function

Thanks,
Jitesh Sojitra.

Mercury Timers

Hi Friends,

Using below method you can use timer method in QTP9.2,

StartTime = MercuryTimers("Timer").Start / 1000
' Operation 1
' Operation 2
EndTime = MercuryTimers("Timer").Stop() / 1000
TotalTime = EndTime - StartTime
Msgbox ""&TotalTime

Regards,
Jitesh Sojitra.

Sunday 27 May, 2007

Connecting QC with QTP using scripting

Hi Friends,

Using below method you can connect QC with QTP,

Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
qtApp.TDConnection. Connect "URL", "DOMAIN", "PROJECT", "USERNAME", "PASSWORD", False

Regards,
Jitesh Sojitra.

SendKeys Method in QTP

Hi Friends,

Use Sendkeys method using below help,

Reference - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/4b032417-ebda-4d30-88a4-2b56c24affdd.asp
set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "Brand Names"wait 2
WshShell.SendKeys "NUM"

Thanks,
Jitesh Sojitra.