How to make arguments optional in a function?
Answers were Sorted based on User's Feedback
Answer / ramchandra patil
Hi Narendra,
Good question!
See basically QTP does not support optional arguments but u
can achieve this with following ways-
1. You can pass NULL or Empty values
2. By using dictionary object
I am agree with Subbu...
@Meenu we use optional in front of statement if we wanted
to execute the statement at some criteria..we never use
Optional keyword while passing arguments to function...n I
think narendras question is related to function...
hey guys let me know if I am wrong with valid solution and
please do post if u know any other way..
Thanks in Advance..
Ramchandra
9699851282
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / akshay kumar
this is not possible as default VBS doesn't support this. Instead you can pass a blank scring and have a default value if arguments r not required.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / murtaza j habib
make any function and call it anywhere in your file
but don't upload that function which showing you a error in
your file because it is useless
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / subbu
In QTP we dont use "Optional" keyword just like in VB.
But work around is use Dictionary object. It is just like
multi dimension arrays.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sushma
Suppose there is alogin window in the user name we can type
any thing but while running its giving som eerror we can
avoid tht error actually
so, we can make tht tsl as an optional so tht if an error
occurs it countinues but not stop
for example
Optional.Dialog("Login").WinEdit("Name:").Set "ssss"
these line make an optional now
| Is This Answer Correct ? | 1 Yes | 7 No |
Answer / meenu
basically by prefixing 'Optional.' in front of the statement
| Is This Answer Correct ? | 0 Yes | 7 No |
Hi Guys, I tried to install java add-in for QTP 9.5 after the whole installation but it didn't install but then i also found in documentation saying that winrunner7.6 patch for java plugin would work fine with QTP. But when i tried to install from winrunner7.6 it asks me for the path of winrunner So my question is are we supposed to install winrunner for java add in to work on QTP. Please suggest me
We have 10 page.In first page we 2 popup and next page we 3 popup window......(windows name is different)how can we handle the all the popups without using recovery scenario
What is the real use of different actions in QTP
The string is like POWER STAR PAVAN , write a script for this how to findout the number of "A" in the string ?
Do we get any issues if we run the testscript on different browsers? what are the options we need to st in QTP?
What are the Features & Benefits of Quick Test Pro ?
Why a framework is needed?? Plaese post your answers ASAP
What are the Features & Benefits of Quick Test Pro ?
How we can merge the object repositories?say if we have 2 or 3 object repositories then how we can merge them?Is there any option in QTP to merge the object repositories?
How we test web based application by using QTP
1.what is test automation life cycle?
In a shared Object Repository in QTP if some object is changed how can the other script which is using the same object can be known