June 09, 2013

VBScript Questions and Answers

VBScript is a scripting language used to create test automation in tools such as UFT and TestComplete. In addition, it is used to automate user tasks on Windows computers. Learn VBScript in detail using my free VBScript video tutorials. Then attempt the below quiz on VBScript.
 
Each question in this quiz has four options with one best answer. The score is updated at the bottom left as you answer each question. Try it.

1. Which browser has built-in support for executing VBScript?
Internet Explorer
Mozilla Firefox
Opera
None of these

2. Which statement is true for VBScript names e.g. variable names or procedure names?
They are case sensitive.
They are case insensitive.
They are case insensitive but should be written consistently for readability.
Only variable names are case insensitive.

3. What is the datatype of a variable in VBScript?
String
Variant
It is the datatype specified when that variable is declared.
None of the above

4. What is the difference between the Sub procedure and Function procedure?
Only the Sub procedure can perform actions
Both procedures can take arguments
Only the Function procedure can return a value
All of the above

5. In the Select Case statement, which case is used for unknown cases?
Else
Default
Unknown
Not

6. Which loop is used to iterate till a condition becomes true?
For Next loop
For Each Next loop
Do While loop
Do Until loop

7. What is the purpose of the Set keyword in VBScript?
Assign a value to any variable
Assign a value to an object variable
Declare an array
Configure the VBScript program

8. Which VBScript function returns the day of the week for any date?
Date
Day
Weekday
Now

9. Which VBScript function converts an input string to all lowercase?
LCase
LowerCase
Lower
There is no such function to directly convert to lowercase.

10. Which VBScript function can compare two strings?
StringCompare
Compare
StrComp
StrCompare

Score is 0/ 10.
Mention your scores in the comments below.