Saturday 2 June, 2007

Getting Test Name from QC

Hi Friends,

Below post is useful to get test name from quality center.

Set td=createobject("TDApiOle80.TDConnection.1")
td.InitConnectionEx "http://qc/qcbin"
td.ConnectProjectEx "DOMAIN", "PROJECT","USERNAME", "PASSWORD"
Set tstMgr = td.TreeManager
Set tsttr = tstMgr.NodeByPath("subject\functionality\SUB FOLDER NAME")
Set tsetFact = tsttr.TestFactory
Set tsetList = tsetFact.NewList("")
For Each tset in tsetList
Msgbox ("Test Name = " & tset.Name)
Next

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.