UFT Class 20 (Overview on VBScript)
I) Introducing VBScript
Visual Basic Scripting Edition
> VBScript was launched inwards 1997
> Vendor: Microsoft
> VbScript derived from VB Programming language
> VBScript non a illustration sensitive language
Ex:
Dim a
A = 100
Msgbox a '100
> VBScript ignores extra spaces
Ex:
Dim a
a = 100
Msgbox a
Ex 2:
Dim a 'Space is Mandatory
a = 100 'Spaces optional
> VBScript is Platform dependent
> No formalities for writing statements
> using : symbol nosotros tin bring together statements
Ex:
Dim a : a = 100 : Msgbox a
> Using _ symbol nosotros tin split upwards statements
Ex:
Msgbox _
"Hello UFT"
II) Scripting Languages Versus Programming Languages
--------------------------------------------------------------------------
Scripting Languages Programming Languages
---------------------------------------------------------------------------
Ex: Shell, Perl, VBScript, COBOL, C, C++, Java, VB, C# etc...
JavaScript, Python, Ruby, Rexx etc...
----------------------------------------------------------------------------
Interpreter based Compiler based
(At a fourth dimension compilation) (Step past times measurement compilation)
----------------------------------------------------------------------------
Steps:
> Writing the code > Writing code
> Executing code > Compiling the code
> Executing the code
--------------------------------------------------------------------------
Implicit Declaration of Explicit proclamation of Data types
Data types
VbScript Java
Dim a int a;
a = 100 a =100;
----
---- char b;
a ="abcd"
--------
---------
a = 1.23
-------
-------
a = #10/10/2010#
------------------------------------------------------------------------
Explicit together with Implicit declaration Explicit proclamation of Variables
of Variables
VbScript: Java:
Dim a int a;
a = 100 'Explicit variable a = 100;
b= 200 'Implicit variable b = 200; \\ Error
Msgbox a + b
----------------------------------------------------------------------
Limited Support for UI design Rich back upwards for UI design
----------------------------------------------------------------------
Limited back upwards for Application Rich back upwards for Application development
development
------------------------------------------------------------------
Limited back upwards for Graphics design Rich back upwards
------------------------------------------------------------------
Can last easily integrated with Difficult to integrate
other technologies
------------------------------------------------------------------
Reduce the code size Increase the code size
-----------------------------------------------------------------
III) Usage of VBScript
1) Clint side scripting inwards the Web
> Browser (IE) executes VBScript code
> Web developers integrate VBScript code components into HTML tags
2) Server side scripting inwards the spider web
> Web server (IIS) executes VBScript code
> Web developers integrate VBScript code inwards ASP.
3) Network Administration on Server OS (ex: Windows 2008 server)
> AOM (Automation Object Model) executes VBScript code
4) System Administration on Client OS (ex: Windows 7)
> AOM executes VBScript code.
Note: AOM is an direction tool of Windows operating organization together with
It has VbScript engine, whatever file comes amongst .vbs extension together with then AOM launches
VbScript engine, it executes VbScript code.
If yous desire execute Perl code from Windows,
> Download together with install Perl engine
> Write Perl code inwards regime notation pad together with salve amongst .pl extension.
> Any file comes .pl the AOM launches Perl engine
--------------------------------------------------
5) Test Automation (UFT)
> VBScript engine integrated inwards UFT, It tin execute VBScript code.
-------------------------------------------------------------------
Sumber http://www.gcreddy.com/
I) Introducing VBScript
Visual Basic Scripting Edition
> VBScript was launched inwards 1997
> Vendor: Microsoft
> VbScript derived from VB Programming language
> VBScript non a illustration sensitive language
Ex:
Dim a
A = 100
Msgbox a '100
> VBScript ignores extra spaces
Ex:
Dim a
a = 100
Msgbox a
Ex 2:
Dim a 'Space is Mandatory
a = 100 'Spaces optional
> VBScript is Platform dependent
> No formalities for writing statements
> using : symbol nosotros tin bring together statements
Ex:
Dim a : a = 100 : Msgbox a
> Using _ symbol nosotros tin split upwards statements
Ex:
Msgbox _
"Hello UFT"
II) Scripting Languages Versus Programming Languages
--------------------------------------------------------------------------
Scripting Languages Programming Languages
---------------------------------------------------------------------------
Ex: Shell, Perl, VBScript, COBOL, C, C++, Java, VB, C# etc...
JavaScript, Python, Ruby, Rexx etc...
----------------------------------------------------------------------------
Interpreter based Compiler based
(At a fourth dimension compilation) (Step past times measurement compilation)
----------------------------------------------------------------------------
Steps:
> Writing the code > Writing code
> Executing code > Compiling the code
> Executing the code
--------------------------------------------------------------------------
Implicit Declaration of Explicit proclamation of Data types
Data types
VbScript Java
Dim a int a;
a = 100 a =100;
----
---- char b;
a ="abcd"
--------
---------
a = 1.23
-------
-------
a = #10/10/2010#
------------------------------------------------------------------------
Explicit together with Implicit declaration Explicit proclamation of Variables
of Variables
VbScript: Java:
Dim a int a;
a = 100 'Explicit variable a = 100;
b= 200 'Implicit variable b = 200; \\ Error
Msgbox a + b
----------------------------------------------------------------------
Limited Support for UI design Rich back upwards for UI design
----------------------------------------------------------------------
Limited back upwards for Application Rich back upwards for Application development
development
------------------------------------------------------------------
Limited back upwards for Graphics design Rich back upwards
------------------------------------------------------------------
Can last easily integrated with Difficult to integrate
other technologies
------------------------------------------------------------------
Reduce the code size Increase the code size
-----------------------------------------------------------------
III) Usage of VBScript
1) Clint side scripting inwards the Web
> Browser (IE) executes VBScript code
> Web developers integrate VBScript code components into HTML tags
2) Server side scripting inwards the spider web
> Web server (IIS) executes VBScript code
> Web developers integrate VBScript code inwards ASP.
3) Network Administration on Server OS (ex: Windows 2008 server)
> AOM (Automation Object Model) executes VBScript code
4) System Administration on Client OS (ex: Windows 7)
> AOM executes VBScript code.
Note: AOM is an direction tool of Windows operating organization together with
It has VbScript engine, whatever file comes amongst .vbs extension together with then AOM launches
VbScript engine, it executes VbScript code.
If yous desire execute Perl code from Windows,
> Download together with install Perl engine
> Write Perl code inwards regime notation pad together with salve amongst .pl extension.
> Any file comes .pl the AOM launches Perl engine
--------------------------------------------------
5) Test Automation (UFT)
> VBScript engine integrated inwards UFT, It tin execute VBScript code.
-------------------------------------------------------------------