adspace


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

Hybrid framework supports Descriptive programming. Is it true?

1245


can anyone tell me from where i can download qtp demo or crack version

2090


how can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods

2027


Hi. please provide license key for QTP 9.2, I have windows XP on my machine Thanks in Advance, moreshwar

3322


Tell some commonly used Excel VBA functions?

1148


How are actions and functions different in QTP?

1165


How can you identify the browser and its information using QTP script?

1096


How software tester can use constants and variables in scripts?

2361


can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?

2175


can any body tell me how i create a simple script and apply output value on it .pls send me a step by step process

1878


I am in .Net development for past 3.5 years and want to enter in to automated testing and learn QTP. For this I need some good tutorial for beginners. I will be really greatful if any one has and they can send it to me on this address- ruchidureja@gmail.com

2088


Hi, how can we check or avoid the memory leakage in QTP9.2?

2183


can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com

2334


Hi friends did any budy attend accenture system test for qtp? if any budy pls drop questions.not only accenture any other mnc company which you attended system test(QTP)?it may helpful to others also

2406


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

2158