Depends on where the variable is defined. If the variable is defined in action it is available to that action only.
Q.72How can u write a script without using a GUI in QTP?
Q.72How can u write a script without using a GUI in QTP?
GUI in Qtp?do you mean to say Object repository?without OR,tester need to write descriptive tests,where you would directly assign property values and write methods.you do not need to save OR.
There also u follow the same procedure. See the sample code
Function addition(x,y)
z= x+y
msgbox z
End Function
Call addition(1,2)
Call addition(2,2)
I think i am clear :)
Function addition(x,y)
z= x+y
msgbox z
End Function
Call addition(1,2)
Call addition(2,2)
I think i am clear :)
No function is available in QTP to load Object repository. when you open test ,associated Repository will be loaded automatically.
While recording a script QTP recognizes the objects by its properties. These objects properties and values are stored in Object repository. When you run your test, QTP compares these objects properties with the run time objects properties.
[Files]
NumberOfFiles=2
File1=C:Program FilesMercury InteractiveQuickTest ProfessionalTestsmailobjectexample;1
File2=C:Program FilesMercury InteractiveQuickTest ProfessionalTestsatch2_test;1
this is just a sample hope this would help any dbts get back.
NumberOfFiles=2
File1=C:Program FilesMercury InteractiveQuickTest ProfessionalTestsmailobjectexample;1
File2=C:Program FilesMercury InteractiveQuickTest ProfessionalTestsatch2_test;1
this is just a sample hope this would help any dbts get back.
You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.
QTP uses vbscript for recording. All the features ( functions) of vbscript are supported by QTP script. QTP scrips consist ofcheckpoint,synchronization,DDT functions, iteration repeat statements,action call etc.
QTP script generates the vbscript and usual repository also. When ever execute the QTP script it will call the repository. But if we write the vb script, no need to use repository. Its execute directly from the script.
It is possible through shared only
You can use The following functions
Asc Function====
CBool Function===
CByte Function===
CCur Function===
CDate Function===
CDbl Function===
Chr Function===
CInt Function===
CLng Function
CSng Function
CStr Function
Hex Function
Oct Function===etc
Asc Function====
CBool Function===
CByte Function===
CCur Function===
CDate Function===
CDbl Function===
Chr Function===
CInt Function===
CLng Function
CSng Function
CStr Function
Hex Function
Oct Function===etc
# It contains the following key elements: Title bar, displaying the name of the currently open test, Menu bar, displaying menus of Quick Test commands, File toolbar, containing buttons to assist you in managing tests, Test toolbar, containing buttons used while creating and maintaining tests, Debug toolbar, containing buttons used while debugging tests. Note: The Debug toolbar is not displayed when you open Quick Test for the first time. You can display the Debug toolbar by choosing View ? Toolbars ? Debug. Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. Note: The Action toolbar is not displayed when you open Quick Test for the first time. You can display the Action toolbar by choosing View ? Toolbars ? Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically. Test pane, containing two tabs to view your test-the Tree View and the Expert View ,Test Details pane, containing the Active Screen. Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test. Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.) Status bar, displaying the status of the test
am giving one exmple passing the values into 2 actions
Step1 : U will select the Action1 Properties and set input and output
parameters
'Action1 Script
Dim sum
sum = Parameter("t") 'Input parameter
msgbox(sum)
Parameter("a")=89 'Output Parameter
Step2 : Go to Action2
'Action2 Script
RunAction "Action1", oneIteration,"20",x
Msgbox(x) ' First Action Output parameter comes to Action2 Automatically
exitrun()
Step1 : U will select the Action1 Properties and set input and output
parameters
'Action1 Script
Dim sum
sum = Parameter("t") 'Input parameter
msgbox(sum)
Parameter("a")=89 'Output Parameter
Step2 : Go to Action2
'Action2 Script
RunAction "Action1", oneIteration,"20",x
Msgbox(x) ' First Action Output parameter comes to Action2 Automatically
exitrun()
Logical name is a name or description given by the tool while creating an object to uniquely identify it from other objects in the application.This name would be used by the tool to identify the object during run session.Labels take the place of logical names most of the times.
Yes, we can call Any numbers of Test Scripts from Main Script.
For this, whatever scripts you want to call, you need to make The Actions in those scripts are Re-Usable actions. And then you can give a call to these scripts.
For this, whatever scripts you want to call, you need to make The Actions in those scripts are Re-Usable actions. And then you can give a call to these scripts.
I dont think we can schedule tests in QTP.
But We can schedule tests in Quality center.
But We can schedule tests in Quality center.
No comments:
Post a Comment