Automation testing QTP with VB Script functions Interview questions


Total available count: 68
Subject - Software Testing
Subsubject - Automation testing QTP with VB Script functions

Select Case statement?

Select Case statement executes one of several groups of statements, depending on the value of an expression. 

 Syntax:
 Select Case testexpression
   [Case expressionlist-n
      [statements-n]] . . .
   [Case Else expressionlist-n
      [elsestatements-n]]
End Select

Arguments:
testexpression:  Any numeric or string expression.
expressionlist-n: Required if Case appears. Delimited list of one or more expressions.
statements-n: One or more statements executed if testexpression matches any part of expressionlist-n.
elsestatements-n: One or more statements executed if testexpression doesn't match any of the Case clauses.

Example: 

'Select Case
Colour = Ucase( Inputbox("Please enter the colour of your choice"))
 Select Case Colour
	 Case   "RED"    
		MsgBox  "Colour selected is Red"    
	 Case   "BLUE"
		MsgBox  "Colour selected is Blue"    
	Case   "GREEN"                                                                            
		MsgBox  "Colour selected is Green"                                                                                                 
	Case   ELSE
		MsgBox  "Invalid Colour"
  End Select

 




Next 5 interview question(s)

1
While...Wend statement?
2
With statement?
3
FSO(File system object)?
4
Object/Collection Description?
5
Creating a FileSystemObject Object?

Comments