How we can add actions in the test using QTP?

Answer Posted / sandeep

Please refer to this VB Script.

You can add new action programmatically also.

' Dim qtApp, ActionContent, ActionName, ActionDescr,
NewAction, SecondAction, script
Set qtApp = CreateObject("QuickTest.Application") ' Create
the application object
qtApp.Launch
qtApp.Visible = True
qtApp.New

ActionContent = "Window(""Calculator"").WinButton
(""1"").Click" & vbCrLf & "Window(""Calculator"").WinButton
(""+"").Click" & vbCrLf & "Window(""Calculator"").WinButton
(""+"").Click" & vbCrLf & "Window(""Calculator"").WinButton
(""="").Click"
ActionDescr = "A new sample action for the test."
ActionName = "Action" + CStr(qtApp.Test.Actions.Count + 1)

'Add a new action at the begining of the test

Set NewAction = qtApp.Test.AddNewAction(ActionName,
ActionDescr, ActionContent, False, qtAtBegining)



For Attributed like ActionContent, please read all text
from any Text file in which you have already written some
code.


With this help you can generate new QTP Script pretty
quickly.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe function procedure in vbscript.

551


What are the challenges u faced in testing with crm domain? How u overcome with?

1485


Write a script to customize the test results in PDF and HTML format.

2082


What is the difference between a Function and Action in QTP?

588


What is a programmatic description?

603






how can i pass a "automation script" as a parameter in a function give me need full suggestion thank inadvance

1424


Tell me about your project? please help me how to tell about insurance project

1533


What is accessibility check point?

655


Hi all can any one give me roles and responsibilities for QTP (not WINRUNNER)

3217


How you are developing the script? Using record and play back or manual?

633


What is reusable action?

599


explain keyword driven framework with banking domain?

1563


What is the script for database check point, bitmapchek point, regular expression ?

1553


Can any one tell me.......How the test engg's start testing in the compy environment.....real time tester PLSSSS help me i need in depth information regarding this...

1489


How many types of parameters are available in quicktest professional (qtp)?

585