SDET- QA Automation Techie

Full Stack QA Automation Testing Blog

  • Home
  • Training
    • Online
    • Self-Paced
  • Video Tutorials
  • Interview Skills
    • HR Interview Questions Videos
    • Domain Knowledge
  • Career Guidance
  • Home
  • Software Testing
    • Manual Testing Tutorials
    • Manual Testing Project
    • Manaul Testing FAQS
    • ISTQB
    • AGILE
  • Web Automation Testing
    • Java Programmng
    • Python Programmng
    • Selenium with Java
    • Selenium with Python
    • Robot Framework(Selenium with Python)
    • selenium with Cucumber
    • TestNG+IntelliJ
    • Mobile App Testing(Appium)
    • JMeter
  • API Automation Testing
    • Rest Assured API Testing (BDD)
    • Rest Assured API Testing (Java+ TestNG)
    • Robot Framework(Rest API Testing with Python)
    • Postman
    • SoapUI
    • API Testing(FAQ's)
  • SDET|DevOps
    • Continuos Integration
    • SDET Essentials
    • AWS For Testers
    • Docker
  • SQL
    • Oracle(SQL)
    • MySQL for Testers
    • NoSQL
  • Unix/Linux
    • UNIX TUTORIALS
    • Linux Shell Scripting
  • ETL Testing
    • ETL Data warehouse Tutorial
    • ETL Concepts Tools and Templates
    • ETL Testing FAQ's
    • ETL Testing Videos
  • Big Data Hadoop
  • Video Tutorials
  • ApachePOI Video Tutorials
  • Downloads
    • E-Books for Professionals
    • Resumes
  • Automation Essencials
    • Cloud Technologies
      • Docker For Testers
      • AWS For Testers
      • Sub Child Category 3
    • Java Collections
    • Selenium Locators
    • Frequently Asked Java Programs
    • Frequently Asked Python Programs
    • Protractor
    • Cypress Web Automation

VB Script Built-in Functions

 Descriptive Programming, QTP, UFT, vb scripting   

Types of Vbscript Functions

  • Conversions (25)
  • Dates/Times (19)
  • Formatting Strings (4)
  • Input/Output (3)
  • Math (9)
  • Miscellaneous (3)
  • Rounding (5)
  • Strings (30)
  • Variants (8)
Important Functions

1) Abs Function
Returns the absolute value of a number.
Dim num
num=abs(-50.33)
msgbox num

2) Array Function
Returns a variant containing an Array
Dim A
A=Array("hyderabad","chennai","mumbai")
msgbox A(0)
ReDim A(5)
A(4)="nellore"
msgbox A(4)

3) Asc Function
Returns the ANSI character code corresponding to the first letter in a string.
Dim num
num=Asc("A")
msgbox num

* It returns the value 65 *

4) Chr Function
Returns the character associated with the specified ANSI character code.
Dim char
Char=Chr(65)
msgbox char

* It returns A *

5) CInt Function
Returns an expression that has been converted to a Variant of subtype Integer.
Dim num
num=123.45
myInt=CInt(num)
msgbox MyInt

6) Date Function

Returns the Current System Date.

Dim mydate
mydate=Date
msgbox mydate

7) Day Function


Ex1) Dim myday
myday=Day("17,December,2009")
msgbox myday

Ex2) Dim myday
mydate=date
myday=Day(Mydate)
msgbox myday

8) DateDiff Function
Returns the number of intervals between two dates. 
Dim myday
mydate=#02-17-2009#
x=Datediff("d",mydate,Now)
msgbox x

9) Hour Function

Returns a whole number between 0 and 23, inclusive, representing the hour of the day. 
Dim mytime, Myhour
mytime=Now
myhour=hour (mytime)
msgbox myhour

10) Join Function
Returns a string created by joining a number of substrings contained in an array. 
Dim mystring, myarray(3)
myarray(0)="Chandra "
myarray(1)="Mohan "
myarray(2)="Reddy"
mystring=Join(MyArray)
msgbox mystring

11) Eval Function

Evaluates an expression and returns the result.

12) Time Function 
Returns a Variant of subtype Date indicating the current system time.
Dim mytime
mytime=Time
msgbox mytime

13) VarType Function 
Returns a value indicating the subtype of a variable.

Dim MyCheck
MyCheck = VarType(300) ' Returns 2.
Msgbox Mycheck

MyCheck = VarType(#10/19/62#) ' Returns 7.
Msgbox Mycheck

MyCheck = VarType("VBScript") ' Returns 8.
Msgbox Mycheck

14) Left Function

Dim MyString, LeftString
MyString = "VBSCript"
LeftString = Left(MyString, 3) ' LeftString contains "VBS".


14) Right Function


Dim AnyString, MyStr
AnyString = "Hello World" ' Define string.
MyStr = Right(AnyString, 1) ' Returns "d".
MyStr = Right(AnyString, 6) ' Returns " World".
MyStr = Right(AnyString, 20) ' Returns "Hello World".

15) Len Function


Returns the number of characters in a string or the number of bytes required to store a variable. 

Ex 1): Dim Mystring
mystring=Len("G.C.Reddy")
msgbox mystring

Ex 2): Dim Mystring
Mystring=Inputbox("Enter a Value")
Mystring=Len(Mystring)
Msgbox Mystring

16) Mid Function
Returns a specified number of characters from a string.
Dim MyVar
MyVar = Mid("VB Script is fun!", 4, 6) 
Msgbox MyVar

* It Returns ‘Script’ *

17) Timer Function
Returns the number of seconds that have elapsed since 12:00 AM (midnight).

Function myTime(N)
Dim StartTime, EndTime
StartTime = Timer
For I = 1 To N
Next
EndTime = Timer
myTime= EndTime - StartTime
msgbox myTime
End Function 
Call myTime(2000)

17) isNumeric Function


Dim MyVar, MyCheck
MyVar = 53 
MyCheck = IsNumeric(MyVar)
msgbox MyCheck 

MyVar = "459.95" 
MyCheck = IsNumeric(MyVar)
msgbox MyCheck 

MyVar = "45 Help" 
MyCheck = IsNumeric(MyVar) 
msgbox MyCheck 

* It Returns True/False like Result *

18) Inputbox Function
Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns the contents of the text box.

Dim Input
Input = InputBox("Enter your name") 
MsgBox ("You entered: " & Input)

19) Msgbox Function

Displays a message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked.
Dim MyVar
MyVar = MsgBox ("Hello World!", 65, "MsgBox Example")














  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to TwitterShare to Facebook
Newer Post Older Post Home
popup

Popular Posts

  • How To Explain Project In Interview Freshers and Experienced
    “ Describe an important project you’ve worked on ” is one of the most common questions you can expect in an interview. The purpose of a...
  • API/Webservices Testing using RestAssured (Part 1)
    Rest Assured : Is an API designed for automating REST services/Rest API's Pre-Requisites Java Free videos: https://www.you...
  • MANUAL TESTING REAL TIME INTERVIEW QUESTIONS & ANSWERS
    1. How will you receive the project requirements? A. The finalized SRS will be placed in a project repository; we will access it fr...

Facebook Page

Pages

  • Home
  • Resumes
  • Job Websites India/UK/US
  • ISTQB
  • Selenium with Java
  • E-Books for Professionals
  • Manual Testing Tutorials
  • Agile Methodology
  • Manual Testing Projects

Live Traffic

YouTube


Blog Visitors

Copyright © SDET- QA Automation Techie | Powered by Blogger
Design by SDET | Blogger Theme by | Distributed By Gooyaabi Templates