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

whenever U using QTP,Test Director, Why we using separate Bug tracking tool?

1568


Mention what are the different types of recording modes in qtp? Which will be used when?

564


How you can decide which type of object repository you have to use?

707


HI, pls help me on this, iam not able to capture getcelldata value in javatable... msgbox javawindow("").javatable("").getcelldata(3,3) but it diaplays empty...

2399


Hi,Sudhanandareddy plz forword framework and ppts for QTP to me. This is my mail id: ranjith_99reddy@yahoo.co.in (your contact number also)

1738






i need code for how to click on particular mail in utlook mail box .its urjent Thank You Balaji

1582


How is recording done when a application is over lapping the QTP application it gives a message object not recorded

1573


Give me some real time point of way where exactly we can conduct audits?

1502


What is the difference between call to existing action and copy of an action?

605


How the exception handling can be done using quicktest professional (qtp)?

571


Explain the N-tire structure(process) for Funds Transfer ( means give N ways to funds Transfer in an Application)

1637


what type of values given to objects. EX::Set oBrowser=Description.Create oBrowser(“micclass”).Value=”Browser”

1490


What are the different properties of an web object

1428


can i compare two databases using QTP ?

1884


How the smart identification is used in real time?Please explain with an example

1549