Friday

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



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.InitConnection strServer, strDomain
     objTDConnection.ConnectProject strProject, strUser, strPassword
   
     Set objTreeManager = objTDConnection.TestSetTreeManager
     Set sourceFolder = objTreeManager.NodeByPath(sourceFolderPath)
     Set destFolder = objTreeManager.NodeByPath(destFolderPath)
   
     Dim iscp As ISupportCopyPaste
         
     Set iscp = sourceFolder

     clipboard = iscp.CopyToClipBoard(sourceFolder.NodeID, 0, sourceFolderPath)

     Set iscp = destFolder
     iscp.PasteFromClipBoard clipboard, destFolder.NodeID, 0, -1

     Set treeMng = Nothing
     Set sourceFolder = Nothing
     Set destFolder = Nothing
     Set iscp = Nothing
   
End Function


Happy Testing!

Thursday

QTP 11.0 - Patches till April 2011


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:
  • 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.
  • Testing applications in Internet Explorer when Internet
  • Explorer is in protected mode.
  • Support for Oracle Forms 11g.Enhanced support for OracleTable objects.
  • This patch adds support for testing PowerBuilder 12 applications
  • This patch adds support for testing SAP CRM 7 (a.k.a. ICWC 7, Interaction Center Web Client 7)
  • This patch installs an updated version of the .NET Add-in, providing testing support for Silverlight 2, 3 and 4.
  • This patch provides official support for testing Web applications in Firefox 3.6
http://support.openview.hp.com/downloadAPatch.jsp?patchName=QTPWEB_00063.EXE&prodName=qtp&prodRelease=11.0

QTPNET_00062

This hotfix fixes the following problems:

1. QuickTest Professional sometimes caused .Net 4 WPF applications with multiple AppDomains to crash.

2. QuickTest Professional sometimes caused an error message to be displayed by the application when

spying on a specific WPF combo box.

QTPNET_00066

1. This hotfix enables a custom server to instruct QuickTest Professional  to assign a logical name to a test object by implementing a 'logical_name' property defined in its CustomPropInterface.

2. This hotfix enables a custom server to define run methods that include optional parameters by tagging the parameters with the [Optional] attribute. To do this, the argument element's IsMandatory attribute needs to be set to 'false' in the test object configuration file.
 
3. Prior to this hotfix, QuickTest would sometimes ignore the return value of a custom server's IsKnownPartOf method when applied to a combo box child.

4. Prior to this hotfix, QuickTest would sometimes load into the application all the assemblies in the folder containing the custom server dll.

Monday

VBScript Code beautifier / Formatter


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.

Thursday

Selenuium and Cucumber



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.

Wednesday

FizzBuzz


 
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 this simple problem.

---------------------------------------------------------------------------------------------------------------
Lets look at the simple algo:

For n = 1 To 100
 Select Case 0
   Case n Mod 15
      f = "FizzBuzz"
   Case n Mod 3
      f = "Fizz"
   Case n Mod 5
      f = "Buzz"
   Case Else
      f = n
 End Select
 Print f
Next n

Tuesday

Browse from VBScript


 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!

Thursday

Quick Overview on Agile Scrum


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-weekly
  • Value - Focus on highest valued features first
  • Working 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 ?
  • SCRUM
  • Adaptive Software Development - replaces the traditional waterfall cycle with a repeating series of speculate, collaborate, and learn cycles.
  • Crystal - contains the following properties frequent Delivery of Usable Code to Users , reflective Improvement.
  • Dynamic System Development Method (DSDM) - Its goal is to deliver software systems on time and on budget while adjusting for changing requirements along the development process.
  • Extreme Programming - it advocates frequent "releases" in short development cycles (timeboxing), which is intended to improve productivity and introduce checkpoints where new customer requirements can be adopted.
  • Feature Driven Development (FDD) –At start of project: Develop an Overall Model, Build a Features List, Plan by FeatureWithin each iteration: Design by Feature, Build by Feature
Scrum - Introduction
  • Scrum (an abbreviated form of scrummage), in the sports of rugby, is a way of restarting the game, when the ball has gone out of play.
  • Scrum is an iterative incremental framework for managing projects.
  • Focuses on managing systems with changing requirements
  • The goal is to deliver as much quality software as possible within a series of short intervals. 
Scrum - Process
 Sprint
  • Scrum projects make progress in a series of “Sprints”
  • Timeframes are called Time-boxes (typically 2 – 4 weeks)
  • Every Sprint team does the following: Analysis -> Design -> Code ->Test
  • At the end of each Sprint, the Team must produce a potentially shippable product increment.
Scrum Framework 
  1. Roles : Product Owner, Scrum Master, Team
  2. Artifacts : Product Backlog, Sprint Backlog, and Burndown Chart
  3. Ceremonies : Sprint Planning, Sprint Review, Sprint Retrospective, & Daily Scrum Meeting  
Product Owner
 

  • Represents (or is) the user or customer for the project.
  • Defines goals for the overall project
  • Knowing what to build and in what sequence
  • Defines and Prioritizes Features
  • Set length of calendar time for Sprint
    • Typically 2-4 weeks
    • Does not interfere with Sprint (no scope creep)
    • Release dates. Accepts or rejects work.
 Scrum Master
  • Supports the Team
  • Facilitates the Daily Scrum meeting. Asks each developer:
    • What did you do yesterday?
    • What are you doing today?
    • What is in your way?
  • Listens and watches carefully during Scrum meeting
  • Secures resources if needed
  • Communicates to Product Owner
Scrum Team
  • Typically 5-10 people
  • Cross-functional - QA, Programmers, UI Designers, etc.
  • Members should be full-time/dedicated
  • Teams are self-organizing
  • Members can change only between sprints 
Scrum’s three Artifacts
Product Backlog :
  • Requirements
  • A dynamic list of all that is desired to work on the project
  • Prioritized by the Product Owner based on business value
  • Reprioritized at the start of each Sprint
  • Each feature has an associated estimate, provided by the ACTUAL team who will do the work
  • High priority features are split into “stories” achievable within an iteration.
  • Each “story” is prioritized and scoped.
  • Prioritized based on business value (Very High, High, etc.) by the Product Owner. 
Sprint Backlog :
 
  • A subset of Product Backlog Items, which define the work for a Sprint 
  • Usually has more details including planned hours and primary person responsible to do the work during the Sprint 
  • Is created ONLY by Team members 
  • Should be updated every day 
  • If a task requires more than 16 hours, it should be broken down 
  • Team can add or subtract items from the list. Product Owner is not allowed to do it
 
Sprint Burndown Chart:
  • Provides visibility into the Sprint 
  • Demonstrates progress by the team 
  • Work on the Horizontal, Time on the Vertical 
  • Depicts the total Sprint Backlog hours remaining per day. 
  • Ideally should burn down to zero to the end of the Sprint 
  • It is never a straight line. 
Scrum’s three ceremonies:
 
Sprint Planning Meeting:
 
  • Product Owner reviews: Vision, Roadmap, Release Plan 
  • Team reviews: Estimates for each item on Backlog that is a candidate for the Sprint
  • Team pulls the work: From the Product Backlog onto the Sprint Backlog
Daily Scrum Meeting 
  • Short (15 - 30 min) frequent meetings, facilitated by the Scrum Master
  • All team members attend
  • One activity – Scrum Master asks each attendee 3 questions 
  • Both Chickens and pigs are invited 
  • Only pigs can talk
Sprint Review Meeting 
  • Team presents what it accomplished during the sprint 
  • Typically takes the form of a demo of new features or underlying architecture 
  • Informal  2-hour prep time rule 
  • Starts with: Product Demo Led by Product Owner 
  • Ends with: Sprint Retrospective Led by Scrum Master
    •What worked?
    •What didn’t?
    •What adjustments can we make now?
What is a User Story? 
 
  • Short descriptions of features that need to be coded and tested
  • Simple requirements
  • Generally written on 3X5 index cards 
  • Form: As [a type of user] I want to [perform a specific action] such that [result]
  • Example: “As a web user, I want to
    • Make safe searches, such that I may
    • have filtered search results”
  • Stories that are big are called EPICS