Skip to main content


Showing posts from March, 2010

Testing XPath in Firebug

Given the lack of testing hooks in web applications, many a times Selenium Users use XPath to work on UI Objects. So far I used to use Selenium IDE to test XPath in Firefox. I read a blog post here and got to know that Firebug itself can be used to test XPath. This is accomplished using $x function in Firefox. Consider that highlighted text box does not have a constant identifier hence following XPath is to be used > $x("//input[@name='search']") Write this XPath on Console of Firebug and hit enter - Keep mouse pointer on 'input' in console and it would highlight the text box in page. Using Firebug Lite Firebug can be used for other browsers as well and in turn to test XPath on other browsers.......

Working with URL Redirection with VB Scripts

Had chance to work on checking http status VB script. Looks like not all objects work when used URL redirect, so I used "WinHttp.WinHttpRequest.5.1". Set winhttpreq = CreateObject("WinHttp.WinHttpRequest.5.1") 'Initialize HTTP Request winhttpreq.Open "Get", "" 'Send HTTP Request winhttpreq.Send() Print winhttpreq.StatusText Print winhttpreq.ResponseText for now iteamic website redirects to ciber and this code works perfect for it.

VB Script and Square Brackets '[]'

I had tough time working with vb script and square brackets '[]'. Looks like square bracket has special meaning when it comes to regular expression in vb script. I was trying to write DP for check box collection on page as - ****************************************************************************** Browser("name:=.*").Page("title:=.*").WebCheckBox("name:=publishedSectionId[0]").Set "ON" ****************************************************************************** Execution of this line resulted in following error - ****************************************************************************** "Cannot identify the object "[ WebCheckBox ]" (of class WebCheckBox). Verify that this object's properties match an object currently displayed in your application." ****************************************************************************** I wonder if this error makes any sense, any ways problem is with square br

Data Driven Testing with QTP Using Excel ADO

We all are aware of externalizing test data from test scripts in test automation. We often stumble upon using excel as test data file, and I have seen crude ways of handling excel. i.e. - Creating Excel Application object Opening work book and fetching data Disadvantages of this approach are detailed on Microsoft website here - In a gist following above mentioned approach would be process heavy and would make script execution (especially in case of long running test suites) slow Another crude way is to use sheet-name (which is still acceptable), Row and Column number (i.e. - (2, 5)), Row and Column range (B5, B10). Using row and column identifier is fragile as insertion of new data set in excel would break existing test scripts. A better approach to overcome these is to use ExcelADO along with name of Range in Excel. ExcelADO overcomes process over head and using Range to overcome fragility over Row and Column Range. In excel an

Execute QTP Tests from AOM file

Herein I have got Sample QTP - AOM file. Such sample files are easily available on net but they hard code test path as well as result path. In this sample file I am going to read test path and results path dynamically from with in driver script, which would make script more portable Dim qtpApp 'As QuickTest qtpApplication Set qtpApp = CreateObject("QuickTest.Application") Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable qtpApp.Launch qtpApp.Visible = True qtpApp.Test.Settings.Launchers("Web").Active = False qtpApp.Test.Settings.Launchers("Web").CloseOnExit = True qtpApp.Test.Settings.Run.ObjectSyncTimeOut = 120000 qtpApp.Test.Settings.Run.DisableSmartIdentification = True qtpApp.Test.Settings.Run.OnError = "Dialog" qtpApp.Test.Settings.Web.BrowserNavigationTimeout = 60000 qtpApp.Options.Run.RunMode = "Fast" qtpApp.Options.Run.ViewResults = True qtpApp.O

QTP Glitches So Far...

Well, I have started work on QTP after having worked on couple of functional test automation tools like – Selenium and Test Complete. My first impression with QTP has not been very positive; herein I have listed few glitches I experienced so (I can only hope this list not overgrowing with time) No Refactor of code – so if u modify a function name in one place it has to be updated manually in all function calls “General Run Error” – try to check a check box which is disabled and you receive “General Run Error”! Can’t it say object is disable There have been other mysteriously intermittent instances of “General Run Error” about whom I am still groping in dark If used ExecuteFile to get function definition in Action then there is no way to jump to function definition from action. Function has to be opened manually. (I don’t associate function library as it is going to hardcode path to function) While running QTP tests on a System it can not be used for any other task, QTP keeps b