When and why do you use "OPTION EXPLICIT" in VB Script.
Is there any online help or something to learn the script
for Beginners?
Answer Posted / ritesh mahendrakar
You can declare variables with the Dim, Public or the
Private statement. Like this:
Dim myname
myname = "ritesh"
However, this method is not a good practice, because you
can misspell the variable name later in your script, and
that can cause strange results when your script is running.
If you misspell for example the "myname" variable
to "mynime", the script will automatically create a new
variable called "mynime". To prevent your script from doing
this, you can use the 'Option Explicit' statement. This
statement forces you to declare all your variables with the
dim, public or private statement.
Put the Option Explicit statement on the top of your
script. Like this:
Option Explicit
Dim myname
myname = "ritesh"
| Is This Answer Correct ? | 16 Yes | 2 No |
Post New Answer View All Answers
If I give some thousand tests to execute in two days what do you do?
Difference between copy to action and call to action?
how to idetfy which test cases are automated?who will deside that plz tell me
Hi All, I have QTP installed on my machine but the application under test (AUT) is on remote desktop.My scenarios is like that,it should contain following steps. 1)Automatically it should click on start and then on remote desktop connection. 2)it should enter the IP address and then connect to remote desktop. 3)and then it should be able to record the application in remote machine and then run it also. Can somebody tell me how to record the application which is in remote machine.
How to use checkpoints in qtp ?
When do go for loop condition in test?
How to define array in qtp?
I want two test two agents login for the flight website. Here is the scenario: I want to go through 1-3 rows for one user login and other user login I want to go though 3-5 rows. How would you set this up in qtp. Thank You
How can you write the scripts that operate on different objects depending on run-time information?
what is run action?
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.
Whats the realtime QTP testing process
How can i get the image text that changes dynamically? Here i have used "GetROProperty", but it's not working. I used like Ex:Browser("webmail").Page("inbox").image ("captchaimage).getroproperty("innertext/text/value")
I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.
What are the automation metrice in your project?