what is option explicit? what is the use of it?
Answer Posted / kaps
In VB script it’s not necessary to declare a variable explicitly and we can assign a variable at any step we want. This can cause a problem if the project code is huge (while debugging for any bug in script), as the result may be different than expected.
E.g. we declare a string variable as 'strLogin' to save the login detail but later while assigning by mistake we write 'strLogi' then that Login detail will be saved to 'strLogi' instead of 'strLogin'. This will be a bug in script if we use 'strLogin' afterwards for some other inputs. To prevent such scenario VB script provides 'Option Explicit', which forces user to explicitly declare the variable before using it, otherwise script will throw an error at run time.
Option Explicit
Dim strLogin
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
what are the limitations of smart identification in qtp 9.0
How to replay a script in qtp?
Give the syntax to load function at run time.
how to use the QTP choose the data from oracle? e.g. i input the identity card NO. this will be add new record in the database ,and now i want get this record's prime key.
what is run action?
How you can find the absolute value of the number in qtp?
How to get popup error message.
requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how
suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?
Plz Explain How to access Or Store Script from VSS? Explain Real time work (qtp) where you store folders and next to how to you access that folders and how you maintain folders in VSS ? What are the Menu's in VSS? Suppose in Manual, by using Checkin Checkout u can access documents. how you access in QTp REal time?
How to Upgrade or support firefox 2.0 version on QTP 9.0? I have installed QTP 9.0 and installed firefox 2.0. But in REcord and Run Settings, it shows firefox 1.5 in Web tab for browser selection.
what are the mandatory properties for a tex boxc (scenario?)
How many types of recording modes in the qtp?
What is clean sweep?
QTP script is not working on other's machine..