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
Explain different types of action in qtp?
i have an external excel datasheet where it only contains 3 rows. after qtp executed the code to import the datasheet, the datatable getrowcount method now gives me a different value, lets say 60,000+ instead of only 3. i did not have any values starting from row 4 of my excel file. why is this happening? this also results to the qtp report to load for a very long time.
Is qtp supports uni-code?
I have developed and executed a script successfully, and saved the same to QC. When I tried to execute the script from QC, the script is not executing. What are the possible reasons?”
Explain about Test Fusion Report of QTP?
What is the syntax to call one script from another?
If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?
How you know that a test case is a regression test case
write a script to verify links on any web page by using descriptive method by creating a description object (give a filter condition only link) ... need to verify expected like name by reading
Describe synchronization point.
one screen page,that contains file , browse , update and cancel buttons.when we browse a file it should get update otherwise it should go to previous page.write negative test case for that.
Hi Friends, I worked with 8.2 not with 9.2. Please help me in this prob. I created one script and recorded some think and save as Test 1 then I opened process--open the object repository manager. Switch to file->save->give some name->save as Objectrepo1.tsr file. (This is the global repository file.) Then I went to object repository->tools-> associate repository ->click + icon ->open the previously saved Objectrepo1.tsr file. This is the global repository Now I created one more script and save as Test 2. In this script I am calling script with the Help of "Call of existing action" and I executed but QTP is not able to execute B’cos it is QTP is not able to read the Object Repository of Test 1. Please let me know why? Once I made Script 1 as a shared Obj. Repository so it would not give any Problem. Right?
how can i call function (which has link with excell sheet at a remote location) within another function
How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What's the difference between them? How to handle script issues?
PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME