WORKING WITH QTP

TestEveryThinG

Archive for November, 2009

Use of index property in QTP

Posted by rajivkumarnandvani on November 28, 2009

Hi ALL,

Some time we use index proerty to idendify the object incase object found more than one with same property.
So before adding index property we have to understand that is this property realy required or not becos incase if an object one(unique in application). in case object unique in application and you add index property for that it increase the time to identified the object. In QTP 9.2 it taking more time with respect to QTP 9.5

Here i am showing an example that will show the time calculate withuse of index/creationtime property and without use of this and shows the time difference to execute the steps
First open the QTP application with WEB adding and copy the script in QTP
now open the browser(IE) after open the browser run the script

rem with creationtime

set objBrowser = Description.Create()
objBrowser(“micclass”).value =”Browser”
objBrowser(“CreationTime”).value=0
a= timer
print “with creation time” & Browser(objBrowser).GetROProperty(“title”)
print timer-a

Set objBrowser = nothing

rem without creationtime

set objBrowser = Description.Create()
objBrowser(“micclass”).value =”Browser”

b= timer

print “without creation time” & Browser(objBrowser).GetROProperty(“title”)
print timer-b

Set objBrowser = nothing

Posted in QTP | 4 Comments »

COMPLETE QTP 9.5 30 hours course

Posted by rajivkumarnandvani on November 19, 2009

COMPLETE QTP  9.5          30 hours course

This comprehensive course covers all the essential principles of using Quick Test Professional 9.5 Designed for beginners as well as testers with previous automation experience, it takes the newcomer to QTP from the basic techniques of record & replay in the keyword view, right through to advanced programming skills in the expert view. Throughout the course practical examples are demonstrated, and the delegates get to practice what they have learned in each chapter against windows and web applications.

Course Objectives

  • Understand the key principles of test automation; record & replay, synchronization, checkpoints, data-driven Testing
  • Understand how to structure your automated testing
  • Gain a full understanding of how QTP integrates with the system under test
  • Understand how you can design robust tests against dynamic applications
  • By the end of the course you should have a complete understanding of how to develop reliable, robust QTP test scripts

Key Points in Training Sessions

Record & Playback

How to create a basic script using record & replay in the keyword view

Object Recognition

Explains how QTP recognizes objects in the system under test. Describe Object Repository and different Repositories types.

Synchronization & Checkpoints

How to use synchronization to ensure that QTP waits for your application to complete processes? And how insert checkpoints in your script to test your application?

Multiple Actions

How to break your script down into smaller components called Actions, covers all types of Actions, and how to re-use Actions in other scripts.

Data-driven testing

How to use the built-in Data Table to data driven tests with multiple test cases?

The Expert View

Explain the differences between the Keyword and Expert view and also covers all the debugging features of the QTP Development environment.

Capturing Application Data

Cover the various methods for capturing data from your system under test for checking, or outputting to the Data Table and Results.

Passing Data between Actions

Look at the various techniques for passing data between Actions like tests such as Action Parameters, Global and

Variables, Environment Variables, Data Table.

Custom Checkpoints

How to create your own checkpoints using the Expert view? Demonstrate how to check dynamic data.

Dynamic Objects

How to test dynamic applications whose interfaces change at run-time in QTP? Look at making the Object Repository more flexible, descriptive programming and capturing object collections from your system under test.

Functions

Covers creating procedures in QTP, storing them in function libraries, calling them from scripts, how to override or create new methods for Test Objects.

Object Recognition Problems

Key points for overcoming object recognition problems. Cover the 3 recording modes, Virtual Objects, and mapping custom classes.

For Contact details mail to teachmeqtp@gmail.com OR write in Comment

Posted in QTP | Tagged: | 12 Comments »

Convert HTML text to Simple text VB Script

Posted by rajivkumarnandvani on November 6, 2009

Hi All,

Some time we required HTML text change to simple text here i created a function which will convert your HTML text to simple readable text.

‘ *************************************************************************************
‘ Function Name:    ConvertHTMLtoText
‘ Description:        This function is used to convert HTML string to Simple Text
‘ Arguments:        HTML string

‘ Return Value:        SimpleText
‘‘Syntax of calling the defined function:    Call  ConvertHTMLtoText(strHTML)
‘ *************************************************************************************

Public Function ConvertHTMLtoText(byVal strHTML)
If InStr(1,strHTML,”<“) > 0 Then
Do
startVariable = InStr(1,strHTML,”<“)

endVariable = InStr(startVariable,strHTML,”>”)
varName = Mid(strHTML,startVariable, endVariable-startVariable+1)
strHTML = replace(strHTML,varName,””)
Loop While InStr(1,strHTML,”<“) > 0
End If
strHTML = replace(strHTML,”&gt;”,””)
strHTML = replace(strHTML,”&lt;”,””)
ConvertHTMLtoText = strHTML
End Function

msgbox ConvertHTMLtoText(“<br><br><font color=””””#008000″”””>TestingGUID position 26 with dashes must be one of the following: AB234567</font></body></html>”)

Posted in Miscellaneous | Leave a Comment »

Get Browser(iexplore) Count using VB script

Posted by rajivkumarnandvani on November 1, 2009

bcount = Get_ApplicationCount(“iexplore.exe”)

msgbox bcount

Public Function Get_ApplicationCount( byval sApplicationExe)

Dim strComputer

Dim objWMIService

Dim colProcesses

Dim objProcess

strComputer = “.”

Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)

Set colProcesses = objWMIService.ExecQuery (“Select * from Win32_Process Where Name = ‘”&sApplicationExe&”‘”) Get_ApplicationCount = colProcesses.count

Set objWMIService = Nothing

Set colProcesses=Nothing

End Function

If  bcount >0  Then

set objBrowser = Description.Create()

objBrowser(“micclass”).value =”Browser”

objBrowser(“CreationTime”).value=bcount-1

msgbox Browser(objBrowser).GetROProperty(“title”)

else

msgbox “No internet explorer open”

End If

Posted in QTP, WEB | Tagged: , , , , | Leave a Comment »