Call for votes - Top Automated Software Testing Blogs

Today I've decided to create a list of best & recommended Automated Software Testing Blogs.

It will be extremely useful for every engineer or manager working in QA field and in automated testing especially.

How the list of blogs will be created?
I think, the best way is to ask persons who work in automated software testing. I mean you, my readers!
That's why I ask your help, dear readers.
Your vote is important! Please, email me URLs of your favorite and most valuable blogs on automated testing.
My email is: Dmitry Motevich's email

What blogs can participate?
Blogs can contain any information related to automated testing:
  • working with automated testing tools
  • test automation frameworks
  • automated testing approaches anf methodologies
  • tips, tricks, experience
  • etc.
Please, pay attention, that only blogs can participate in the present poll.
I will create separate lists for automated testing sites, forums etc.

What are criteria to include blog into the list?
I will use these criteria to select most popular automated software testing blogs:

What is a deadline for blogs submitting?
The deadline is an end of October 2008. So, please hurry up :)
I plan to create the final list of Automated Software Testing Blogs in early November 2008 and publish it on my blog.

Update: Top 40 Automated Testing Blogs created :) Thank you very much!



Do you know that you are free to use/copy/publish all my materials on your site/blog?


How to update XML file from QTP

In previous QTP tutorial I shown how QTP can read data from XML file.
Today I will explain how to update XML data from QTP.

We will use this XML file:
Initial XML fileNote: You can download this XML file here.

Let's check how to update different values in above XML file:
  1. How to rename the title of first book?
    The QTP script is:
    Const XMLDataFile = "C:\TestData.xml"
    Const XMLNewFile = "C:\TestData2.xml"

    Set xmlDoc = CreateObject("Microsoft.XMLDOM")
    xmlDoc.Async = False
    xmlDoc.Load(XMLDataFile)


    ' update the title of the first book
    Set node = xmlDoc.SelectSingleNode("/bookstore/book[0]/title")
    node.Text = "Romeo and Juliet - Salvation"

    ' save changes

    xmlDoc.Save(XMLNewFile)
    And the result is:
    Note: The numeration begins from zero. That's why I use book[0] to access first item.


  2. How to change the year of second book?
    I skip the opening and saving of XML file (see above QTP script). I show only the essence:
    ' update the attribute of the second book
    Set node = xmlDoc.SelectSingleNode("/bookstore/book[1]/title/@published")
    node.Text = "2009"

    And the result is:
    Note: Use @ to access an attribute of XML node.


  3. How to add new author add its new attribute?
    QTP script:
    ' select a parent node
    Set parentNode = xmlDoc.SelectSingleNode("/bookstore/book[2]")

    ' add a new author
    Set newNode = xmlDoc.CreateElement("author")
    newNode.Text = "Mr. Noname"
    parentNode.AppendChild (newNode)
    And the result is:
    As you can see, we've added "Mr. Noname" as the new author.


  4. How to add new attribute for author (XML node)?
    QTP script:
    ' select a parent node
    Set parentNode = xmlDoc.SelectSingleNode("/bookstore/book[2]")

    ' add its attribute
    Set newAttrib = xmlDoc.CreateAttribute("bestseller")
    newAttrib.Text = "yes"
    parentNode.Attributes.SetNamedItem(newAttrib)
    The result is:
    New attribute of a boof and its value ("bestseller"="yes") have been added.

Well, the working with XML files from QTP is easy enough.


Summary:
  • shown in QTP - how to change value of XML node
  • shown in QTP - how to change value of attribute
  • shown in QTP - how to add new XML node
  • shown in QTP - how to add new attribute


Do you have any comments, dear reader? Please, leave them below the present article.
Thank you in advance :)



Related articles:


Do you like this QTP tutorial? Would you like to receive them in the future?
If yes, please subscribe to this blog RSS feed or by Email. (How to subscribe? VIDEO guide)




Do you know that you are free to use/copy/publish all my materials on your site/blog?


LoadRunner unique file name with web_save_timestamp_param function

Earlier, I shown two ways how to create unique file names in LoadRunner:

Today I'm going to show the simplest way. And I would like to thank Charlie for his comment.
He suggested to use web_save_timestamp_param function.

web_save_timestamp_param function saves the current timestamp to LoadRunner parameter. Timestamp is the number of milliseconds since midnight January 1st, 1970 (also known as Unix Epoch).

This is how web_save_timestamp_param works:
web_save_timestamp_param("TimeStamp", LAST);
lr_output_message("Timestamp: %s", lr_eval_string("{TimeStamp}"));

And the result is:
Results in LoadRunner Generator
As I explained in this loadRunner tutorial about unique file names in LoadRunner, we have to get unique ids per virtual users with lr_whoami LoadRunner function.

So, the final LoadRunner script is:
char szFileName[256];
int vuserid, scid;
char *groupid;

lr_whoami(&vuserid, &groupid, &scid); web_save_timestamp_param("TimeStamp", LAST);

sprintf(szFileName, "%s_%d_%d_%s",
    lr_eval_string("{TimeStamp}"),
    vuserid,

    scid,

    groupid);


lr_output_message("File name: %s", szFileName);
And its result is from LoadRunner Controller:
Results in LoadRunner ControllerSo, you can add a required file extension (txt, pdf, etc) and get a unique file name. It will work for any number of concurrent virtual users in LoadRunner Controller.


Summary:
  • Shown the way how to generate unique file names in LoadRunner
  • It uses web_save_timestamp_param function


Related articles:


Do you like this LoadRunner tutorial? Would you like to receive them in the future?
If yes, please subscribe to this blog RSS feed or by Email. (How to subscribe? VIDEO guide)




Do you know that you are free to use/copy/publish all my materials on your site/blog?


QTP VBScript - Are you sure 1+1=2?

QTP VBScript contains different niceties. This article shows that 1 + 1 doesn't equal 2 sometimes.

Exactly, 1 + 1 doesn't equal 2 sometimes.

Well, I've prepared this QTP script:
n1 = InputBox("Enter first number")
n2 = InputBox("Enter second number")
n1increased = n1 + 1

If n1increased = n2 Then
    MsgBox n1 & " + 1 equals " & n2
Else
    MsgBox n1 & " + 1 doesn't equal " & n2
End If

I will explain it step by step and show all entered data and generated result.
  1. Read first number from user's input
    I enter 1 as a first number:
    First number = 1
  2. Read second number from user's input
    I enter 2 as a second number:
    Second value = 2
  3. Increase first number by 1
    n1increased = n1 + 1

  4. Check whether first increased number equals to second number
    If n1increased = n2 Then
        MsgBox n1 & " + 1 equals " & n2
    Else
        MsgBox n1 & " + 1 doesn't equal " & n2
    End If

    And the result is:
    The result of QTP script

Do you know why it is so? What is a reason?
The answer is simple. This is due to converting of VBScript types.

After you read first number (1) from user and assign it (value of course value, not user :) ) to variable, this variable has value of String type.
So, this is the same like n1 = "1"

When VBScript executes this line:
n1increased = n1 + 1
it sees, that we perform mathematical operation and converts n1 into number.
Then VBScript calculates n1 + 1 and the result (2) has a numeric type - Double (special double-precision floating-point value).

Here is the main point! 2 as Number is not the same as 2 as String. These values have different type and that's why they differ.
Simple visual example - two apples are not equal to two pears :)

I can demonstrate the above types converting.
I've added this code into our QTP script before if-then-else:
MsgBox "TypeName(n1): " & TypeName(n1)
MsgBox "TypeName(n1increased): " & TypeName(n1increased)
MsgBox "TypeName(n2): " & TypeName(n2)
And its result is:
Results of TypeNameThat's why the value of number variable is not equal to the value of string variable.


Well, How to make that 1 + 1 = 2 ?
Answer: Convert string value to number with CInt function:
If n1increased = CInt(n2) Then
    MsgBox n1 & " + 1 equals " & n2
Else
    MsgBox n1 & " + 1 doesn't equal " & n2
End If

And the result is:
Correct result of QTP scriptIt works. It works correctly :)

I hope, you will keep in mind this issue with VBScript types converting. It can save your time during debugging of QTP scripts.



Related articles:


Do you like this QTP tutorial? Would you like to receive them in the future?
If yes, please subscribe to this blog RSS feed or by Email. (How to subscribe? VIDEO guide)




Do you know that you are free to use/copy/publish all my materials on your site/blog?


LoadRunner Analysis - tabbed world

Do you like this dialog from LoadRunner Analysis? Not too many tabs? :)
LoadRunner Analysis - tabsNo words!
It seems, HP should hire a professional UI designer :)



Related articles:


Do you
know that you are free to use/copy/publish all my materials on your site/blog?


QTP Recovery Scenario VIDEO

This QTP video shows and explains how to create and work with QTP Recovery Scenarios.

For example, during an execution of QTP test, it can be interrupted by different windows, pop-ups, message boxes, etc. The problem is that they can appear at any time and you cannot predict this event.

I've shown how to create QTP Recovery Scenario for the following message box:
Message box in QTP
This message box can be shown or not, depending on the current system settings.
QTP provides Recoverry Scenarios to process such unexpected events and errors.


QTP Recovery Scenario VIDEO



Related articles:


Do you like this QTP video? Would you like to receive them in the future?
If yes, please subscribe to this blog RSS feed or by Email. (How to subscribe? VIDEO guide)




Do you know that you are free to use/copy/publish all my materials on your site/blog?


QTP - How to rename Excel worksheet

The present QTP tutorial shows simple recipe how to rename Excel worksheet from QuickTest Professional.

For example, Excel-file contains 'Sheet1' sheet:
Initial worksheet

How to rename Excel worksheet from VBScript and QTP?

Use the following QTP script, which perform the work using Excel's COM object - "Excel.Application":
Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.DisplayAlerts = False

Set
objWorkbook = objExcel.Workbooks.Open ("c:\Book1.xls")

Set objWorksheet = objWorkbook.Worksheets(1)

objWorksheet.Name = "VBScript_Excel"

objWorkbook.SaveAs ("c:\Book1.xls")
objExcel.Quit

The above QTP script renames Excel worksheet:
Renamed worksheet

Summary:
  • Excel's COM object ("Excel.Application") allows performing operations on Excel application
  • The present visual tutorial explains how to rename Excel sheet from QTP


Related articles:


Do you
like this QTP visual tutorial? Would you like to publish it on your site/blog?
You are free to use/copy/publish all materials on your site/blog.


How to read XML file from QTP

I'm going to show how to parse XML file and read its values from QTP (QuickTest Professional).
For example, we will use this XML file:
This XML file describes a bookstore and books located there.
Note: You can download this XML file here.



I will use Microsoft's XML Parser also known as Microsoft.XMLDOM. This XML parser allows running XPath queries.

The loading of XML file in QTP is simple enough:
Const XMLDataFile = "C:\TestData.xml"

Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)


Several comments on this code:
  1. Microsoft.XMLDOM is a name of COM object of Microsoft's XML parser
  2. Async is a property of Microsoft.XMLDOM.
    The property specifies whether asynchronous download of the document is permitted.
    Processing of asynchronous operations is more complex, that's why I've disabled it (xmlDoc.Async = False). For datailed info see here.
  3. Load method loads an XML document from the specified file.
    Also, you can use LoadXML method, which loads an XML document using the supplied string.

After that we can use SelectSingleNode or SelectNodes of Microsoft's XML parser to execute XPath query.
You can use this approach in QTP to get data from XML file.

Check the above bookstore XML file again and let's see:

  1. How to get number of books in a bookstore?
    The QTP script is:
    Set nodes = xmlDoc.SelectNodes("/bookstore/book")
    MsgBox "Total books: " & nodes.Length

    And its result is:
    Number of books in a bookstoreAs you can see, "/bookstore/book" XPath expression selects all "book" nodes in a "bookstore" nodes. As a result, we get the list of all books.

    I hope, that's clear. Let's complicate the task a bit.


  2. How to get titles of all books in a bookstore?
    QTP script gets list of books from XML file and iterates them through:
    ' get all titles
    Set
    nodes = xmlDoc.SelectNodes("/bookstore/book/title/text()")

    ' get their values
    For i = 0 To (nodes.Length - 1)
        Title = nodes(i).NodeValue
        MsgBox "Title #" & (i + 1) & ": " & Title
    Next

    The result is:
    Titles of all books

  3. How to get title of the first book?
    QTP script is:
    Set node = xmlDoc.SelectSingleNode("/bookstore/book[0]/title/text()")
    MsgBox "Title of 1st book: " & node.NodeValue
    Please see how QTP parses XML file and gets the required value:
    Title of the first bookNote: Pay attention that nodes are zero-indexed, i.e. first book is book[0], second book is book[1], and so on.


  4. How to get titles of all John Smith's books?
    QTP script is:
    ' get list of John Smith's books
    Set nodes = xmlDoc.SelectNodes("/bookstore/book/title[../author = 'John Smith']/text()")

    ' get their titles
    For i = 0 To (nodes.Length - 1)
        Title = nodes(i).NodeValue
        MsgBox "Title #" & (i + 1) & ": " & Title
    Next

    Note: We use square brackets to apply a filter. So, [../author = 'John Smith'] means 'to get only those books whose author is John Smith'.

    Since Mr. Smith wrote two books, we get the following result:
    Titles of John Smith's books

  5. How to get titles of all books published after 2003?
    QTP script is:
    ' get list of books published after 2003
    Set nodes = xmlDoc.SelectNodes("/bookstore/book/title[@published > 2003]/text()")

    ' get their titles
    For i = 0 To (nodes.Length - 1)
        Title = nodes(i).NodeValue
        MsgBox "Title #" & (i + 1) & ": " & Title
    Next

    Note: And again, we use square brackets to apply a filter - [@published > 2003].
    At sign (@) is used to address an attribute of a node. For example:
    Here, title node contains one attribute - published.
    So, [@published > 2003] means 'to get only those books which were published after 2003'.

    The result of above QTP script is:
    Titles of books published after 2003You can check initial XML file and make sure that QTP parses it correctly.

Summary:
  • Use Microsoft.XMLDOM to read and parse XML file from QuickTest Professional (QTP)
  • XPath allows creating different queries to extract required data
  • The present visual tutorial explains how to process XML file from QTP


Related articles:


Do you like this QTP tutorial? Would you like to receive them in the future?
If yes, please subscribe to this blog RSS feed or by Email. (How to subscribe? VIDEO guide)




--
Dmitry Motevich

You're free to use/copy/publish any of my materials

I've started noticing that my blog materials (articles and videos) became quite popular in the Web. That's great! :)

The problem is that some bloggers copy and publish my blog materials without mentioning the source.
Copyrights on http://motevich.blogspot.comSo, I would like to express my point of view on the present issue.


I allow to use content from my blog (http://motevich.blogspot.com) for any purposes.


For that you have to observe 2 following conditions:
  1. Any material (for example, article from the blog) has to be copied and published the same way as it is in my blog, without any changes.
  2. You have to give a link to original material on my blog

Please, note that I allow using my materials for absolutely any purposes, including commercial.
So, I don't mind if you earn money using my knowledge, articles and videos! :)


This post is to be considered as my official permission for copying and publishing.



P.S. I would be grateful if you notify me about a placement of my materials on your sites or blogs :)
My email is:
Dmitry Motevich's email

Dmitry Motevich