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 |
after click on compose mail how can we attached a file in qtp with vbscript code
What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?
draw the qtp frame work?
What is the use of an object spy tool in qtp?
In a webpage how to check the dynamic links that re changing regularly?( without using regular expressions.)
what is regular expression how will you implement it?
is we can import the object repository from external source. if it so then how?
There are some links on the page,count and click those links and check the text on the page displayed on clicking the link.write script for this scenario.
I am new to automation testing.I am learning QTP 9.2.my question is how to install the defferent addins(other than Default Addins) is there any defference in QTP after installing the Addins.where we can get the addins?
How to change the Default synchronization method time and where?
How will u find that how many List boxes( and check boxes) are present in one particular window
What is object & properties (in QTP)