Skip to main content

Posts

how to read CAPTCHA from QTP

Can we read Captcha images from QTP???  Yes!!!! Solution:   *** Need to Zoom the Application upto 400%(Worked for me) and try to execute the below code  *** Captcha image should be visible on your desktop shwnd = Browser("Browser Name").GetROProperty("hwnd") mtxt =  Window("hwnd:=" & shwnd,"index:=0").GetVisibleText Print mtx

Working on CAPTCHA Images in QTP

Note :            *** Need to Zoom the Application upto 400% and try to execute the below code           *** Captcha image should be visible on your desktop shwnd = Browser("Browser Name").GetROProperty("hwnd") mtxt =  Window("hwnd:=" & shwnd,"index:=0").GetVisibleText Print mtxt

Download Test Resource From QC Using QTP

'########################################################################### '* Function Name: QCGetResource '* Designer: Jay '* Date 09-May-2012 '* This script will Download QC Test Resource to a local dir '########################################################################### Function QCGetResource(resourceName,saveTo)     Set qcConn = QCUtil.QCConnection     Set oResource = qcConn.QCResourceFactory     Set oFilter = oResource.Filter     oFilter.Filter("RSC_FILE_NAME") = resourceName     Set oResourceList = oFilter.NewList     If oResourceList.Count = 1 Then         Set oFile = oResourceList.Item(1)         oFile.FileName = resourceName         oFile.DownloadResource saveTo, True     End If         Set qcConn = Nothing     Set oResource = Nothi...

How to run Excel Macro in QTP

Function RunMacro(sPath, sMacroName, sArg1, sArg2)    Set xlApp = CreateObject("Excel.Application")    Set xlWbk = xlApp.Workbooks.Open(sPath)    RunMacro = xlApp.Run(sMacroName, sArg1, sArg2)    xlApp.Quit End Function ***your macro in VBA should be public

Get QC Parameters from Test cases using QTP

'###################################################### '#  FunctionName : getQCParameters '# Purpose: To get  the QC Parameters from Test cases using QTP '# Created By :  Jay '###################################################### Function getQCParameters(strNodeByPath)     On Error Resume Next     'strNodeByPath =  "Subject\02 - System Test\TestCases\Reports\Client Reports"     Set TDC = QCUtil.QCConnection     set TSfact = TDC.TestSetFactory     Set TreeMgr = TDC.TreeManager     Set TestTree = TreeMgr.NodeByPath(strNodeByPath)     Set TestFactory = TestTree.TestFactory     Set TestList = TestFactory.NewList("")     Dim NodesList()     ReDim Preserve NodesList(0)     NodesList(0) = TestTree.Path                      ...

In QTP Excel ADODB Connection Tips

Column headings         By default, it is assumed that the first row of your Excel data source contains columns headings that can be used as field names. If this is not the case, you must turn this setting off, or your first row of data "disappears" to be used as field names. This is done by adding the optional HDR= setting to the Extended Properties of the connection string. The default, which does not need to be specified, is HDR=Yes . If you do not have column headings, you need to specify HDR=No ; the provider names your fields F1, F2, etc. Because the Extended Properties string now contains multiple values, it must be enclosed in double quotes itself, plus an additional pair of double quotes to tell Visual Basic to treat the first set of quotes as literal values NOTE : Special characteristics can’t be accessed using ADODB Connection with Excel. deleting Excel data       You are more restricted in deleting ...