Mercury gives us SAFFRON

Last week, Mercury posted a file for download called "QTP Expert Series - Issue 1". I saw it today and it interested me enough to download it. I'm certainly glad I did, because inside I found a spicy* little example framework called SAFFRON (Simple Automation Framework For Remarkably Obvious Notes).

SAFFRON is far from being a ready-to-use framework, but it does provide some good example code for creating an easy to read and write meta language that doesn't use an Object Repository. It is similar in concept to what the Inquisitors have been working on ... except a lot more light weight.

Here is an example from the SAFFRON FAQ:

QuickTest Script:

Visual Basic:
  1. Browser("Google").Navigate "http://google.com/"
  2. Browser("Google").Page("Google").WebEdit("q").Set "Hello World!"
  3. Browser("Google").Page("Google").WebButton("Google Search").Click
  4. Browser("Google").Page("Hello World! - Google").Link("Hello, World Page").Click

SAFFRON Script:

Visual Basic:
  1. BrowseTo "http://google.com/"
  2. EnterTextIn "q", "Hello World!"
  3. Activate "WebButton", "Google Search"
  4. Activate "Link", "Hello, World Page"

SAFFRON is extremely limited, but it is a step in the right direction. And it is good to know there is at least one person at Mercury who is doing some innovative thinking on test frameworks instead of focusing on how to apply the latest buzzword to the same old record and playback tests.

You can download SAFFRON on Mercury's support site or through this direct link.

* spicy...saffron...get it?

Tags: , , , , ,

4 Comments for “Mercury gives us SAFFRON”

  1. Andy Says:

    It seem to be a good approach.

    But How about the concept of Inquisitors have been working on..?
    Could you show some ideas & code…?

    Reply to Andy

  2. Narendra Singh Says:

    Hi,

    I have created a userdefined object.just i want to know that how can i access its properties.

    ”************************************************************************************************************************
    ‘Description:

    ‘This example opens QuickTest and creates a user-defined object of class “MyCustomListView”, which is mapped to
    ‘a WinListView test object. Once the object is mapped, the settings for mandatory, assistive, and smart
    ‘identification properties are set just as they would be for any regular test object class.
    ‘Assumptions:
    ‘QuickTest is not open.
    ‘************************************************************************************************************************

    Dim qtApp ‘As QuickTest.Application ‘ Declare the Application object variable
    Dim qtOptions ‘As QuickTest.WindowsAppsOptions ‘ Declare a Windows Application Options object variable
    Dim UserDefObj ‘As Object ‘ Declare a user-defined object variable

    Set qtApp = CreateObject(”QuickTest.Application”) ‘ Create the Application object
    qtApp.Launch ‘ Start QuickTest
    qtApp.Visible = True ‘ Make the QuickTest application visible

    Set UserDefObj = qtApp.Options.ObjectIdentification(”WinComboBox”).CreateUserDefinedObject(”mck.common.controls.mylookupeditor”) ‘ Create a user-defined object.
    UserDefObj.OrdinalIdentifier = “location” ‘ Set the selector type for the created user-defined object
    UserDefObj.MandatoryProperties.RemoveAll ‘ Clear the MandatoryProperties list.

    ‘ Create a new MandatoryProperties list
    UserDefObj.MandatoryProperties.Add (”attached text”)
    UserDefObj.MandatoryProperties.Add (”nativeclass”)

    UserDefObj.AssistiveProperties.RemoveAll ‘ Clear the AssistiveProperties list.
    ‘ Create a new AssistiveProperties list
    UserDefObj.AssistiveProperties.Add (”window id”)

    UserDefObj.AvailableProperties.Add(”Select”)
    UserDefObj.AvailableProperties.Add(”GetItem”)

    ‘ Clear the smart identification settings.
    UserDefObj.EnableSmartIdentification = False
    UserDefObj.BaseFilterProperties.RemoveAll
    UserDefObj.OptionalFilterProperties.RemoveAll

    Set UserDefObj = Nothing ‘ Release the user-defined object.

    Reply to Narendra Singh

  3. Narendra Singh Says:

    Hi

    I have run this script and it automatically creates a user defined object. So when I add that object in repository it recognized as combo box.

    Narendra Singh

    Reply to Narendra Singh

  4. sachin Says:

    I am a regular visitor to this wesite. This is a very good article on object repositories.
    please keep on poting such great and informative articles on QTP.

    sachin
    http://qtp.blogspot.com

    Reply to sachin

Leave a Reply