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
Hi friends I need to know about jubula automation tool. Is anybody know in bangalore where jubula tanning class is going on do let me know. Its urgent for me to learn that tool please help.
What are the different types of functions available in qtp and explain ?
can i compare two databases using QTP ?
What are the Test design techniques you uses in ur project?
What is quick test pro? What is a quick test professional?
Explain in brief about the quicktest professional (qtp) automation object model?
how to use the regular expression for the below code-- swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:56" There is a tree view window of the folder's ie Medication- >Pharmacy(sub folder)with 56 as count of records...The records can be different or if no records present in the specific folder..then it show "Paharmacy:-no records".Whe i record at the first time .....and try to rerun the same script with different records count say "pharmacy:800"..qtp is not regnizing it...therefore i want to user regular expression..but donot now how to use it and where to use...i have tried.... swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:\*"..but it s of no use..plz help..me
How do you test DLL files using automation Tool QTP?
when a test case is written how u test using qtp
What is object spy in quicktest professional (qtp)?
how to write xml output check point bu useing descriptive programing .means without useing output check point
What are advantages of test automation?
in my application,validation message has in japanise language.how to validate this message is appears properly or not
How many lines of code in each script of QTP?
How to get the particular property value?