Skip to main content

Posts

Showing posts from May, 2012

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 = Nothing     Set oFilter = Nothing     Set oFlieList = Nothing     Set oFile = Nothing End Function

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