UFT Tutorial 3

UFT Class 3
( UFT Test Process Part -2, UFT Tool window Architecture Part-1)

    12) Using Automation Objects (VBScript)

a) File System Object

It is used to move amongst Drives, Folders as well as files.

i) What is Computer File system?

    It is a characteristic of Operating organisation used to move amongst Drives, Folders as well as files.

ii) Examples for File organisation Operations

Create a Folder

Copy a Folder

Delete a Folder

Create a Text file

Write data

Read data

Compare data

Search operations

Delete a text file etc...
------------------------------------

iii) How goal user performs File organisation Operations?

    End user performs file organisation operations manually amongst the help of Input devices

    If it is ascendency business OS (Ex: DOS, UNIX) amongst help of OS Commands


iv) How to perform automatic File organisation Operations using VbScript?

Using File organisation object

Syntax for Creating Automation Object:

Set Variable = CreateObject("Class Value")

Set -VBScript statement

CreateObject - Built inwards business office of VBScript

Create File System Object:

Set Variable = CreateObject("Scripting.FileSystemObject")

Note: It is entirely for apartment files, but nosotros tin practise as well as delete other types files also.

File organisation object treats them equally apartment files only.
------------------------------------------------------
b) Excel Application Object

It is used to perform operations on Excel Application

Create Excel file

Row count

Read information

Write data

Compare data

Rename sheets

Add sheets

Move sheets etc...

Create Excel Application Object

Set Variable = CreateObject("Excel.Application")
------------------------------------------------
c) Word Application object

It is used to perform operations on give-and-take application

Create Word Application Object

Set Variable = CreateObject("Word.Application")
----------------------------------------------------
d) Database Objects

1) Database Connection object

It is used to connect to a Database (Any Database)

Note: Connection string varies from 1 database to another.

Create Database Connection object:

    Set Variable = CreateObject("Adodb.Connection")
-----------------------------------------
2) Database Recordset object

It is used to perform operations on Database records (Tables)

Create Database Recordset object:

    Set Variable = CreateObject("Adodb.Recordset")
-----------------------------------------
e) Dictionary object   

Dim a(3), b
a(0) = 10
a(1) = 20

It is used to define key, value pairs

Create Dictionary Object

    Set Variable = CreateObject("Scripting.Dictionary")
-----------------------------
13) Error Handling

Handling expected as well as unexpected errors

Expected error:

    Whenever nosotros purpose invalid input, as well as then expected errors

Note: We purpose Invalid input for negative testing

Unexpected Error:

    Availability of Resource

    Insufficient Resource
   
    Resource Response
----------------------------------------------------
IV) Running (Executing) as well as Debugging Tests

Debugging is optional but when it is required?

    Test is non showing whatever errors as well as providing right output - Not required

    Test is showing errors -Optional

    Test is non showing whatever errors as well as Not providing right output -Yes
   
Using VBScript Debug commands as well as Breakpoints nosotros tin debug tests.

Test Run

Single Test Run - Using Run Command

Batch Testing
    Using "Test Batch Runner Tool"
    Using AOM Script (QTP Application Object)
    Using Driver Script (UFT Test)
    Using ALM/QC Tool
------------------------------
V) Analyzing Test Results

Test Result for every Test Iteration

Status of Test Result:

    Pass (If expected = Actual)
    Fail (If expected <> Actual)
    Done (Test executed without errors)
        (* There are no verification inwards our exam as well as then done status)
    Warning (Problems during Test Execution

Define Test Results

UFT Provides Test effect for every exam iteration if nosotros purpose UFT
Tool features similar checkpoints, output values as well as transaction points etc...

If user uses ain logic (VBScript features) the user demand to define exam result.
------------------------------------
VI) Reporting Defects
-----------------------
Functional Test Automation        Defect Management
------------------------------------------------------------
UFT                    Manual (Excel sheet...)
---------------------------------------------------------
UFT                    Bugzilla, Jira etc...
--------------------------------------------------------------
UFT                    ALM
----------------------------------------------------------
UFT Test Process
    I) Test Planning
    II) Generating Basic Tests
    III) Enhancing Tests
    IV) Running as well as Debugging Tests
    V) Analyzing Test Results
    VI) Reporting Defects.
---------------------------------------------------
UFT Tool window Architecture
----------------
Add inwards Manager:

During launching UFT shows Add inwards Manager,
It shows all available Add ins inwards our company,
Select appropriate add together inwards for our Application,

Note: Do non choose unnecessary Add ins, as well as then Tool execution performance volition endure reduced.

Test Tool    AUT
---------------------
Launch UFT Tool starting fourth dimension as well as then AUT,

Note: If nosotros launch AUT first, as well as then UFT may non recognize Application objects.

---------------------------------------
UFT Tool Editor:

It is an expanse where nosotros Create/View/Edit a Test or Test Script.
Using UFT Tool editor nosotros tin delete 1 or to a greater extent than statements.

Note: UFT Test is a file, y'all tin delete UFT exam file from Hard disk.

It has ii views
    Editor persuasion - Test inwards VBScript format
    Keyword persuasion - Test inwards GUI format

View are different, but Test is same.

If nosotros perform whatever alteration inwards 1 persuasion that automatically reflects inwards simply about other view.

Switch from Editor to Keyword view:

    View card -> Keyword view

Switch from Keyword persuasion to Editor:

    View menu-> Editor


UFT Test / Test Script


Test - One or to a greater extent than Actions to perform a chore or tasks

Action - Set of statements to perform a chore or tasks

Statement / Step / Instruction - a minimal executable unit

Note: One exam may convey 1 or to a greater extent than Actions, if it is unproblematic exam purpose unmarried Action
for lengthy exam purpose multiple Actions.

For re-usability nosotros prefer multiple Actions.

Statement    Line

One contention may convey 1 or to a greater extent than lines as well as vice versa.

Ex:
Two statements inwards unmarried line

    Msgbox "Hello UFT" : Msgbox "Hello VBScript"

One Statement inwards Two Lines

Msgbox _
"Hello UFT"
-----------------------------------------
Active Screen:
-------------------

Launch Active Screen

    View menu-> Active Screen

It captures as well as holds covert shot for every user performance on AUT.

Advantage:

Using Active covert nosotros tin easily sympathise as well as Edit Tests

Disadvantage:

It occupies to a greater extent than memory, reduces Tool execution performance.

Configure Active Screen:

Tools menu-> Options -> GUI Testing ->Active Screen-> Increase/Decrease Capture Level->Ok
Note: This characteristic is related to Recording only.

-------------------------------------------

Sumber http://www.gcreddy.com/
Post a Comment (0)
Previous Post Next Post