Wednesday

Why do we need to launch the application under test (AUT) after QTP is launched?


Have you ever wondered why do we need to launch the application under test (AUT) after QTP is launched?
When I started learning QTP I asked the same question to the trainer and he said he would get back on it, after some research i found the answer to my question , sharing here what i learnt ( few years back ) and found ( recently ) :
  • QTP interacts with test applications using windows hooks.
A hook is a point in the system message-handling mechanism where an application can install a subroutine to monitor the message traffic in the system and process certain types of messages before they reach the target window procedure.
  • Therefore these hooks help QTP during recording and identifying objects
  • Hooks can only be installed using DLLs
  • These Hooks can be injected only during runtime when QTP is brought up.
An interesting example from Tarun here :

"Hooks are basically interceptors in system". This example will clear it

User Clicks -> Windows OS determine which Application should get it -> Sends the click to the application.

Now hooks allow to intercept the message and take action accordingly

User Clicks -> Windows OS determine which Application should get it -> Installed Hook (Hook can decide to send the message or cancel it or record it or take some action based on event)->Sends the click to the application.
Happy Testing!

Ten best Open Source Bug Tracking Systems and thier Comparison


In continuation to the prev post on "Ten Best Tools for Test Automation" read another interesting link (toolsjournal) on what are the ten best open source bug tracking systems, so here is the list in no particular order:
  1. Bugzilla
  2. Mantis BT 
  3. Trac
  4. Redmine
  5. OTRS [Open-source Ticket Request System]
  6. Request Tracker
  7. Eventum
  8. BugGenie
  9. WebIssues
  10. Fossil
Click on the links to get more info on any of the tools. Happy Testing!

And if you want a comparison on the tools features here is an excellent link

Tuesday

Last friday's date using VbScript



Some vbscript to get the previous week's date, modify the code and you can do a lot of fun things with the same:

'Gets the last friday's date
 strCurrentSysDate = Date
 strModDate = dateadd("ww",-1,strCurrentSysDate)
 numWeekDay = 6- weekday(strModDate)
 strModifiedDate = dateadd("d",numWeekDay,strModDate)
 strmonth =left(monthname(month(strModifiedDate)),3)
 If len(cstr(day(strModifiedDate))) < 2 Then
  strDate = "0"&day(strModifiedDate)
 else
  strDate = day(strModifiedDate)
 End If
 strYear = year(strModifiedDate)

 strPrevDate =  strmonth& "/" & strDate & "/" & strYear
Msgbox strPrevDate

Monday

Ten Best Tools for Test Automation



Read an interesting link (toolsjournal) on what are the ten best tools for automation , though i wouldnt say that these are the ten best tools , rather they are ten known/popular tools in no particular order:
  1. QTP
  2. Watir
  3. TOSCA Testsuite
  4. Selenium
  5. VISUAL STUDIO TEST PROFESSIONAL
  6. WebUI TEST STUDIO
  7. RATIONAL FUNCTIONAL TESTER
  8. TESTCOMPLETE
  9. TESTPARTNER
  10. SOA TEST

Click on the links to get more info on any of the tools. Happy Testing!

Thursday

Allow other HP products to interact option in QTP and Launch QC explorer


 Here is the code to set "Allow other HP products" option to true before starting automation.

Set objWshShell = CreateObject("WScript.Shell")
Set objApp = createObject("QuickTest.Application")
objWshShell.RegRead("HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\")
        If Err <> 0 Then
            Wscript.Sleep 1000
            objApp.Launch
            objApp.Visible = False
            objApp.Options.Run.RunMode = "Fast"
            objApp.Quit
        End If
        objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\AllowTDConnect","1","REG_DWORD"

'------------------
' Launches QC Explorer
'------------------
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists ("C:\Program Files\Common Files\HP\QCExplorer\QCExplorer.exe") Then
            objWshShell.run "cmd /K CD C:\Program Files\Common Files\HP\QCExplorer\ & QCExplorer.exe http://
qc.com/qcbin/start_a.htm" 
ElseIf objFSO.FileExists ("C:\Program Files (x86)\Common Files\HP\QCExplorer\QCExplorer.exe") Then
            objWshShell.run "cmd /K CD C:\Program Files (x86)\Common Files\HP\QCExplorer\ & QCExplorer.exe http://qc.com/qcbin/start_a.htm"
Else
      Msgbox "QC Explorer not launched as .exe file not found"
End If



Happy Testing!

Test Automation Tools Comparison Matrix - Knol

Today came across an interesting comparison on test automation tools on "knol"

P.S: Click on the link to get the comparison .