Posts

Showing posts from 2011

Selenium 2.0 / Web Driver and Eclipse

Image
Steps to set up web driver and Eclipse:
Open Eclipse from the menu choose File, New, Project...In the folder Java, choose Java Project. Give project a name, accept the rest of the defaults, and click Next.Download the latest zip file for selenium frm : http://seleniumhq.org/download/The latest version right now is : "selenium-java-2.15.0.zip"Unzip the files into the project that you just createdBack in Eclipse, right click on your project in the Package Explorer and choose Build Path, Configure Build Path.... Choose the Libraries tabClick Add JarsSelect all of the jars that you just unzipped into the /lib/selenium-jars/ folder and click OKChoose the primary selenium jar, which in this example is selenium-java-2.15.jar , expand and  double-click on Javadoc location. (Enter the location for the Selenium JavaDocs into the Javadoc location path field htttp://selenium.googlecode.com/svn/trunk/docs/api/java/)Click Ok and u are ready.Right click on the /src folder in your project an…

Install m2eclipse for Indigo

Image
Eclipse does not have integrated Maven support out of the box. To add the support, I am going to use Maven Integration (m2e).
In Eclipse: Help -> Install New Software…Type the following URL in field Work with: http://download.eclipse.org/technology/m2e/releasesClick Add…Give a name for the repository (such as m2eclipse)Click OKSelect the checkbox Maven Integration for EclipseClick Next etc. to move forward and choose to restart Eclipse when prompted

Lets Install Maven

Image
Steps to Install Maven for Windows XP:
Maven is a Java tool, so you must have Java installed.Download Maven from http://maven.apache.org/download.html#InstallationUnzip the distribution archive, i.e. apache-maven-3.0.3-bin.zip to the directory you wish to install Maven 3.0.3Add the M2_HOME environment variable with the value of where you have extracted the zip artchive: C:\Program Files\Apache Software Foundation\apache-maven-3.0.3Add the M2 environment variable in the user variables with the value %M2_HOME%\binUpdate/create the Path environment variable and append the value %M2% to add Maven available in the command line.Make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.5.0_02Restart the machineOpen a new command prompt and type mvn --version to verify that it is correctly installedSource: http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

Happy Testing!!!

Integrate Quality Center with Fitnesse

Image
I had a hard time trying to figure this out , so here are the steps for the basic integration of these two tools :
The same logic can be used to integrate Quality center and any open source tool:

Set up a VAPI-XP-TEST in quality center that will store the script and the logic to run the same.The script would then invoke the opensource tool , in our case Fitnesse from test lab in QC.Once the test is complete we would do two thingsReport a Pass/Fail for the testUpload the results that are generated by the Fitnesse tool into QC Here is the cod e that you need to place in the QC VAPI-XP-TEST:

' FitNesse.SuiteAcceptanceTests.SuiteWidgetTests.SetUpLinkTest [VBScript]
' Created by Quality Center
' ====================================================

' ----------------------------------------------------
' Main Test Function
' Debug - Boolean. Equals to false if running in [Test Mode] : reporting to Quality Center
' CurrentTestSet - [OTA COM Library].TestSet.
'…

VBscript to close any popup message box

Image
A strange thing happened when i was trying to run QTP tests from Quality Center , there was this error message popped up after every test run.
Until the message box was not closed manually QC would wait indefinitely, defeating the whole purpose of automation.



So here is the vbcript that would run indefinitely waiting for the popup; and close it for tests to continue:

Set wshShell = CreateObject("WScript.Shell")
Do
      ret = wshShell.AppActivate("System Settings Change")
      If ret = True Then
          wshShell.SendKeys "%N"
          Exit Do
      End If
      WScript.Sleep 500
  Loop

Steps to use the QTP .NET Extensibility sdk

Image
QuickTest .NET Add-in Extensibility is an SDK package that enables you to support testing applications
that use third-party and custom .NET Windows Forms controls that are not supported out-of-the-box by the .NET Add-in.
We need to create a Custom Server (DLLs or control definition XML file) to handle each custom control.

We shall look at the steps to develop a custom server dll using the .net extensibility kit:
Use the QTP Setup program to install the QuickTest Professional .NET Add-in Extensibility SDK on your computer.Create a new project in VS2008 or above and select the Visual C# > Windows node in the Project types treeVisual C# >













 3.  In the Application Settings page, specify the following settings: Server class name e.g. TrackBarSrvSelect the Customize Record process check box.Select the Customize Run process check box.Accept the rest of the default settings.4.  Click Next. The XML Configuration Settings page opens
In the XML Configuration Settings page, specify the follow…

Testing the parachute for a change!

Image

Solution to warning in Quality Center shows FAIL

Image
I am sure a lot of QTP users who run their tests from quality center must have noticed that a test passes with warning , but when the test set is closed it turns into fail.

Solution: The best way is to modify the registry setting or use the below code: WshShell.RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\"&_ "Logger\Media\TD\TreatWarningAs","TREAT_AS_PASS","REG_SZ"

If the tests are failing the key (TreatWarningAs)would have "TREAT_AS_FAIL" change this to TREAT_AS_PASS and you would be relieved for sure ;)

Hope this helps,
Happy Testing!

Website's underlying technology for automation

Image
Like most testers, you probably automate a certain number of websites.. Ever wonder how those websites work? What technologies does that website or blog use? What is the underlying software that the website runs on?
These are all good questions before starting automation on a website and not always easily determined by just viewing a website.
Sitonomy is a cool web service that you can use to get information about a website, such as what technology is used to run the website, what advertising the site uses, the programming language for the website, what kind of server it is running on, and lots more. To add to that : http://stackoverflow.com/questions/396739/how-do-you-determine-what-technology-a-website-is-built-on

Solution to "this test is locked by another quality center user"

Image
There are a lot of instances while working with Quality center that you might have noticed this message "this test is locked by another quality center user” Sometimes you may have imposed a self lock on it.. J This happens mostly when the user kills the QTP process when the script is still open(from QC).
If you have forgotten the machine where you have imposed a self lock then don’t worry as here is the soln to get rid of the same:
Copy the following code and run it from the machine were qc is instantiated.
On Error Resume Next
desc = "Please provide the network id for the user, and please make sure" &_
        "this user is logged out prior to removing locks"   
UName = InputBox(desc,"Provide network id")  
If(UName <> "") Then     
  Set cmd = TDConnection.Command      
  cmd.CommandText = "DELETE FROM Locks WHERE LK_USER = '" & UName & "'"       
  cmd.Execute      
  MsgBox "All locks …

Maximize browser using QTP and IE8 / IE7 / Firefox

Image
Problem : Maximize a tabbed browser (ie7/ie8/firefox) Solution1:  hwnd=Browser("name:=myBrowser").getROProperty("hwnd")
               Window("hwnd:="&hwnd").Maximize Disadvantage:  Does not work with tabbed browsers consistently
Solution2:hwnd=Browser("name:=myBrowser").Object.HWND
              Set objWindow=Window("hwnd:="&hwnd2)               objWindow.Maximize
Disadvantage:  Does not work with tabbed browsers when there are multiple browsers open
Solution3: SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe",URL,"C:\","open","3"
The "3" at the end Activates and Maximizes the window.
Disadvantage:  Does not work when the browser is already open

Solution4: Set WshShell = CreateObject("WScript.Shell")
               'Alt Space X - shortcut to maximize ie browser.                 WshShell.SendKeys "% x"

Hope this helps as always :)
Happy Testing!

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

Image
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 objectsHooks can only be installed using DLLsThese 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…

Ten best Open Source Bug Tracking Systems and thier Comparison

Image
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:
BugzillaMantis BTTracRedmineOTRS [Open-source Ticket Request System]Request TrackerEventumBugGenieWebIssuesFossilClick 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

Last friday's date using VbScript

Image
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

Ten Best Tools for Test Automation

Image
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:
QTPWatirTOSCA TestsuiteSeleniumVISUAL STUDIO TEST PROFESSIONALWebUI TEST STUDIORATIONAL FUNCTIONAL TESTERTESTCOMPLETETESTPARTNERSOA TEST
Click on the links to get more info on any of the tools. Happy Testing!

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

Image
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:…

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 .





QTP - Wait for web page to load completely

Image
There are instances when there isn't any unique property or object to check on the landing page during a browser navigation, in such cases we can use either of the below options to code:

set objReadyState = Browser("").Page("").Object
While objReadyState.readyState = "Completed"
Wend
Set Object=nothing


Set Object=Browser("").object
While Object.Busy=True
Wend
Set Object=nothing

Happy Testing!

Code to get tagnames and values from an xml

Image
In continuation from the previous post where we try and get the attribute values from an xml, here is the code where we get the tag names and its values :


Const xmlFile1= "C:\Test.xml" Set xmlDoc1 = CreateObject("Msxml2.DOMDocument")
xmlDoc1.load(xmlFile1)
set nodes1 = xmlDoc1.selectNodes("//*")
for i = 0 to nodes1.length -1
        tagname1 = nodes1(i).nodeName
        val1 = nodes1(i).text
        If  tagname1= "test" Then
                msgbox tagname1
                msgbox val1
                Exit for
        End If
next

Hope this helps , happy testing!

Golden Rules for Career Success - Richard Moran

Image
Loved this article and thought its apt for the skillset label on my blog , so here it is for the benefit of others:

WORKING as a business consultant all over the world, I have discovered some basic career-related rules that everyone should know but many don’t.

Business is made up of ambiguous victories and nebulous defeats. Claim them all as victories. Keep track of what you do; someone is sure to ask.Be comfortable around senior managers, or learn to fake it.Never bring your boss a problem without some solution.You are getting paid to think, not to whine.Long hours don’t mean anything; results count, not effort.Write down ideas; they get lost, like good pens.Always arrive at work 30 minutes before your boss.Help other people network for jobs. You never know when your turn will come.Don’t take days off sick unless you are.Assume no one can / will keep a secret.Know when you do your best morning, night, under pressure, relaxed; schedule and prioritize your work accordingly.Treat every…

Skillset - Test Automation Developer

Image
In continuation of my previous posts that are tagged "Skillset" , Here is what a company is looking for when they want a "Test Automation Developer"

Overview:

The Test Automation Developer will build and execute test automation scripts using QTP, Selenium, Macro or Mobile automation test tools for functional system integration and business acceptance testing under multiple platforms and cross-browsers.

Responsibilities:

• Write automation test plans & strategies, convert & or write test scripts, perform test execution, provide result documentation & metrics reporting.
• Build automation framework in QTP
• Collaborate with Quality Assurance Analyst – subject matter expert to gather requirements for automation development and provide guidance to execution of scripts
• Provide technical knowledge on multiple projects simultaneously.
• Solid written and verbal communication skills
• Proven automation development experience
• Proficient in testing …

Code to copy a test set from one folder to another in Quality Center

Image
I am sharing this info as I had to do quite a research before i found the solution.

Problem:  Copy a test set from one folder to another in Quality Center test lab using code.

First things first: This cannot be coded in vbscript or QTP as it uses the ISupportCopyPaste interface and the CopyToClipboard method which is part of this interface. Therefore you cannot declare a statement like Dim iscp As ISupportCopyPaste

A simpler way would be to use vba and do the following:

1. Add the following code in excel vba editor.
2. Add the "OTA COM Type Library" as a reference under tools -> references from excel.
3. Run and enjoy the magic :-)

Solution:

Public Function CopyPasteTestSetFolder(sourceFolderPath, destFolderPath)

     strServer = "http://xyz/qcbin"
     strDomain = ""
     strProject = ""
     strUser = ""
     strPassword = ""

     Set objTDConnection = CreateObject("tdapiole80.TDCONNECTION")
     objTDConnection.InitConnecti…

QTP 11.0 - Patches till April 2011

Image
Here are a set of patches that might help wrt  QTP 11.0:

QTP_00699
QTP 11 support for 64-Bit applications. The 64-Bit technologies that are currently supported: - .Net
- Java
- WPF
- Standard

http://h20230.www2.hp.com/selfsolve/document/FID/DOCUMENTUM_QTP_00699

QTP_00709 Recovery scenarios did not work in BPT wrapper tests. Run-time errors were displayed if you ran a business component that contained a QCUtil.CurrentTest.Name step. Function libraries that were created from an QuickTest crashed or an OS blue screen appeared when using a User-Defined / Non-HLLAPI emulator on Windows 7 with Office 2007/2010 installed. http://h20230.www2.hp.com/selfsolve/document/FID/DOCUMENTUM_QTP_00709

WEB_00073 Testing applications in Internet Explorer when Internet Explorer is in protected mode. http://support.openview.hp.com/downloadAPatch.jsp?patchName=QTPWEB_00073.EXE&prodName=qtp&prodRelease=11.0

ORACLE_00010 Support for Oracle Forms 11g.Enhanced support for OracleTable objects. http://s…

VBScript Code beautifier / Formatter

Image
For a long time was looking for some tool that would quickly format the vbscript files that I had. Here is an amazing tool that will help you do the same:

Both the source code and the exe are available for download from here:VBSBeautifier - Daan Systems

Features:

· Comes with a nice GUI.
· Works on serverside and clientside VBScript.
· Can be used as a text filter in editors.
· Skips HTML.
· Properizes keywords.
· Splits Dim statements.
· Places spaces around operators.
· Indents blocks.
· Lines out assignment statements.
· Removes redundant endlines.
· Makes backups.

Selenuium and Cucumber

Image
Since both Selenium and Cucumber are my fav tools , Found an interesting deck on slideshare titled : "Using Selenium and Cucumber to test a Healthcare Information System"

This was presented at the Selenium Conference April 2011 - San Fransisco by Andy Tinkham. 

Here is the link to download the same.

FizzBuzz

Image
Try solving this very simple program which is asked in many interviews, especially to testers who use a lot of scripting in automation:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and For the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”This is also a game played in the pubs , where players generally sit in a circle. The player designated to go first says the number "1", and each player thenceforth counts one number in turn. However, any number divisible by three is replaced by the word fizz and any divisible by five by the word buzz. Numbers divisible by both become fizz buzz. A player who hesitates or makes a mistake is either eliminated or must pay a forfeit, such as taking a drink.


 Most tester's who know to code are not able to solve this simple problem. Out of every ten automation engineers i have interviewed 9 weren't able to solve…

Browse from VBScript

Image
Something very simple yet complicated is trying to get a browse dialog using vbs.
So here is a snippet that will help in adding a Browse dialog like in the pic , instead of a message box asking for the absolute/relative path of the folder:

Const EDITBOX = &H10
Const DIALOGSTYLE = &H40
Set objShell = CreateObject("Shell.Application")
Set objFolder= objShell.BrowseForFolder(0, "My Computer:",EDITBOX Or DIALOGSTYLE)

Browse = objFolder.Items.Item.path
If Err.Number > 0 Then
    MsgBox("You have not selected a folder." & vbCrlf & "This script will not continue!")
    Err.Clear
Else
    wscript.echo Browse
End If

Hope this helps!

Quick Overview on Agile Scrum

Image
Before we do more Scrum, we should know what is Agile: What is Agility? “Values, principles and practices that foster team communication and feedback to regularly deliver customer value through working software.”

Team communications - Concentrate more on communication and collaboration rather than process and tools Feedback - lots and lots of daily feedback with all stake holders involved - Regularly Deliver - Software releases every quarter with internal releases weekly or bi-weeklyValue - Focus on highest valued features firstWorking Software - Focus on getting S/W working early and keeping it releasable rather than big-bang waterfall approach Agile Values 
Emphasize face-to-face communication over written documents. Agile teams are located in a single open office sometimes referred to as a bullpen. Highlight working software as the primary measure of progress. Produce very little written documentation relative to other methods 
What are the Agile methods ? SCRUMAdaptive Software Develop…