Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Tuesday 28 May 2019

Difference between System Testing vs Integration Testing?

Most of the Software applications which are developed are usually broken into many modules and given to different teams.  These modules are then usually developed individually and later on integrated to form the complete software application. When two or more modules are combined and tested, it is called integration testing.  After all the modules are combined and the complete system is made, testing of the whole system is known as System Testing.
Before going into the differences let us first understand each type of testing in brief :

What is System Testing?

System Testing is testing of the software application as a whole to check if the system is complaint with the user requirements. It is an end to end user perspective testing intended to find defects in the software system.
System Testing is a type of black box testing technique thus the knowledge of internal code in not required. It is a high level testing always performed after integration testing. Regression and Re Testing is performed many times in system testing. The user can perform different type of tests under System Testing .It would depend on the user or the organisation to choose which type of system testing should be performed on the application. System testing can be broadly classified in two types:
  1. Functional Testing
  2. Non Functional Testing

Objective of System Testing:

System testing is performed to check the following points:
  • To check whether the software system is made according to the customer needs written in Software Requirements Specifications, it meets both functional and non-functional design requirements of the system.
  • When all the modules are combined as a whole, many errors and facts may arise which may not give the expected results? So system testing is performed to find the defects or bugs in all the interfaces as well the whole system.
  • To execute the real –life scenarios on the software. It is done on the staging server which is very much similar to the production server where the software would actually be deployed. The system test cases are made according to the end- to – end use perspective.

What is Integration Testing?

Integration testing tests the interface between modules of the software application.  The different modules are first testing individually and then combined to make a system. Testing the interface between the small units or modules is integration testing. It is usually conducted by software integration tester and in continuation to the development.  There are different techniques available for integration testing:
  1. Big Bang Integration Testing: In type of integration testing all the modules are combined first and then tested together.
  2. Top Bottom Integration Testing: This type of testing take place from top to bottom uses Stubs which are substitutes of components. The top module is tested first.
  3. Bottom to Top Integration Testing: This type of testing take from bottom to top and uses Drivers which are substitutes of components. The bottom module is tested first.

Objective of Integration Testing:

Integration testing is performed to check the following points:
  • To check whether the modules developed by individual developers when combined are according to standards and gives the expected results.
  • When modules are combined, sometimes the data travelling between modules has many errors which may not give the expected results. So integration testing is performed to find the defects or bugs in all the interfaces.
  • To check the integration between any third party tools used

Difference between System Testing and Integration Testing:

System TestingIntegration Testing
1. Testing the completed product to check if it meets the specification requirements.1. Testing the collection and interface modules to check whether they give the expected result
2. Both functional and non-functional testing are covered like sanity, usability, performance, stress an load .2.Only  Functional testing is performed to check whether the two modules when combined give correct outcome.
3. It is a high level testing performed after integration testing3. It is  a low level testing performed after unit testing
4.  It is a black box testing technique so no knowledge of internal structure or code is required4. It is both black box and white box testing approach so it requires the knowledge of the two modules and the interface
5. It is performed by test engineers only5. Integration testing is performed by developers as well test engineers
6. Here the testing is performed on the system as a whole including all the external interfaces, so any defect found in it is regarded as defect of whole system6. Here the testing is performed on interface between individual module thus any defect found is only for individual modules and not the entire system
7. In System Testing the test cases are developed to simulate real life scenarios7. Here the test cases are developed to simulate the interaction between the two module
8. The System testing covers many different testing types like sanity, usability, maintenance, regression, retesting and performance8. Integration testing techniques includes big bang approach, top bottom , bottom to top and sandwich approach.

Wednesday 22 May 2019

Working with WebList in UFT

Ways to select value from WebList...?

Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").WebList ("name:=lr").Select"#3"
Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").WebList ("name:=lr").Select (1)
Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").WebList ("name:=lr").Select"English"

To Count Number of WebList in a Page Using Mic Class ... ?

Set oWebList=Description.Create
oWebList("micclass").value="WebList"
set objList=Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").ChildObjects(oWebList)
vrCount = objList.Count

For i=0to vrCount-1
    msgbox objlist(i).getroproperty("name")
Next


To Count Number of WebList in a Page Using HTMLTag.... ?

Set oWebList=Description.Create
oWebList("html tag").Value = "SELECT"
Set objList=Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").ChildObjects(oWebList)
vrCount = objList.Count

For i=0to vrCount-1
        msgbox objlist(i).getroproperty("name")
Next

To Get Values of  all items present in any particular WebList  ....?

 vrItemCount = Browser("name:=Google Advanced Search").Page ("title:=Google Advanced Search"). WebList("name:=as_filetype")._ GetROProperty("items count")

    For j=1to vrItemCount
        vrValue = Browser("name:=Google Advanced Search"). Page("title:=Google Advanced Search"). WebList("name:=as_filetype")._ GetItem(j)
        msgbox vrValue
    Next

To Get All the Values of  all WebList  in a WebPAge ...?

Set oWebList=Description.Create
oWebList("micclass").value="WebList"
set objList=Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search"). ChildObjects(oWebList)
vrCount = objList.Count

For i=0to vrCount-1
    vrWebListName = objlist(i).getroproperty("name")
    vrItemCount = Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").WebList("name:="&vrWebListName).GetROProperty("items count")
    msgbox vrItemCount
    For j=1to vrItemCount
        vrValue = Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").WebList("name:="&vrWebListName).GetItem(j)
        msgbox vrValue
    Next
Next

To Check Existence of Item in Web List ...?

Function fnWebLIstItemExistence(vrSearchItem)

    vrItemCount = Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").WebList("name:=as_filetype").GetROProperty("items count")
    msgbox vrItemCount


    For j=1to vrItemCount
        vrWebItem = Browser("name:=Google Advanced Search").Page("title:=Google Advanced Search").WebList("name:=as_filetype").GetItem(j)
            If vrSearchItem = vrWebItem Then
                Reporter.ReportEvent micPass, "Result", "vrSearchItem Exist in the Web List"
            Else
                Reporter.ReportEvent micFail, "Result", "vrSearchItem not Found in the Web List"
            EndIf
    Next

EndFunction


Call fnWebLIstItemExistence("Shockwave Flash (.swf)")

To Select more than one Item in a WebList ...?

'The following example uses the ExtendSelect method to select two additional items from a WebList object and then checks
'if the items were actually selected. The results of the
'check are sent to the Test Results.

Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").Select"Rugby Shirt"
Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").ExtendSelect "Leather Jacket"
Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").ExtendSelect "Boots"

'Check if all items that were selected in the previous steps are
'actually selected in the list and send

CurrentSelection = Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").GetROProperty("selection")
If CurrentSelection <> "Rugby Shirt;Leather Jacket;Boots"Then
    Reporter.ReportEvent micFail, "ExtendSelect", "The list does not contain all of the selected items."
Else
   Reporter.ReportEvent micPass, "ExtendSelect", "The list contains all selected items."
EndIf
'The following example uses the ExtendSelect method to select two additional items from a WebList object and then checks

'if the items were actually selected. The results of the
'check are sent to the Test Results.

Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").Select"Rugby Shirt"
Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").ExtendSelect "Leather Jacket"
Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").ExtendSelect "Boots"

'Check if all items that were selected in the previous steps are
'actually selected in the list and send

CurrentSelection = Browser("Find a Flight: Mercury").Page("Fill-Out Form Example").WebList("what-to-wear").GetROProperty("selection")
If CurrentSelection <> "Rugby Shirt;Leather Jacket;Boots"Then
    Reporter.ReportEvent micFail, "ExtendSelect", "The list does not contain all of the selected items."
Else
   Reporter.ReportEvent micPass, "ExtendSelect", "The list contains all selected items."
EndIf

Monday 13 May 2019

The array functions allow for the manipulation of arrays.

Array() : The Array() functions returns a variant containing an array. 

Note: The first element in the array is zero.

This function has the form: 

Array(arglist): 

arglist: A list (separated by commas) of values that is the elements in the array.

Examples: Uses of the array function

a=Array(5,10,15,20)
Msgbox (a(3))

Output: 20


a=Array(5,10,15,20)
For Each x in a
    Msgbox (x)
Next

Output: 
5
10
15
20

Filer():  The Filter() function returns  a zero-based array that contains a subset of a string array based on a filter criteria.

Note: If no matches of the value parameter  are found, the Filter function will return an empty array.

Note: If the parameter inputstrings is Null or is NOT a one-dimensional array, an error will occur.

This function has the form:

Filter(inputstrings, value[,include [, compare]])

inputstrings: (required) A one-dimensional array of strings to be searched.
value: (rquired) The string to search for 
include: (Optional) A Boolean value that indicates whether to return the substrings that inlcude or exclude value. True returns the subset of the array that contains value as a substring. False returns the subset of the array that does not contain value as substring (default=True)
compare: (optional) Specifies the string comparision to use. This parameter can have one of the following values: 
0=vbBinarCompare- Perform a binary comparison 
1=vbTextCompare-Perform a textual comparison.

Example: 

Filter items that contains "S" 

a=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
b=Filter(a,"S")
For each x In b
    Msgbox(x)
Next

Output: Sunday
Saturday


Items that does NOT contain "S" (include=False)

a=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
b=Filter(a,"S",False)
For each x In b
    Msgbox(x)
Next

Output: 

Monday
Tuesday
Wednesday
Thursday
Friday


Items that  contain "S" with a textual comparison (compare=1)

a=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
b=Filter(a,"S",True,1)
For each x In b
    Msgbox(x)
Next

Output: Sunday
Tuesday
Wednesday
Thursday
Saturday








Thursday 9 May 2019

Environment variables in QTP are like global variables in other programming languages which can be accessed through any part of the script. The values of these variables remains same irrespective of the number of iterations (unless you change them through scripting). These variables can prove to be very useful when you want a variable to be shared across various reusable actions.
There are two types of environment variables in QTP.
1. Bulit In
2. User defined
BuiltIn environment variable:
These are the internal variables that are provided by QTP. Among others they can provide you valuable information like the path of the folder where test is located, the path of the results folder, the name of the action iteration or the OS version. 
These environment variable are built in QTP. You can get following information from builtIn environment variables in QTP
– Local host name
– Operating System name
– OS version
– Path of the directory where the QTP is installed
– Name of the product (QTP)
– Name of test ( Main project file)
– Current directory path at you are working
And lots many thing, To know builtIn variable just go to File->setting->environment tab.
You can see list of built in environment variables with name and description.
Now You might be thinking of following question. This you will find very useful when you want to get some value dynamically(when QTP is running).
How to get value from environment variable during run time?Answer: If you want to know the path of the folder in which test is located. Just write following lines in your script, you will get what you want.
Dim strTestDir
strTestDir=environment.Value(“TestDir”) ‘ Make sure T and D is capital
msgbox strTestDir
Note:- Please write variable name as it appears in environment tab. It is case sensitive.
User defined environment variable:
These can be further defined into two types.
  • User defined Internal
    • These are the variables that we define within the test.
    • These variables are saved with the test and are accessible only within the test in which they were defined.
    • So how can we define and use them?
      To define them: Environment.Value(“name”)= “Ankur Jain”To call them: msgbox Environment.Value(“name”)
  • User defined External
    • These are the variables that we predefine in the active external environment variables file.
    • These can be created using a list of variable-value pairs in an external file in .xml format. This is a topic of a separate post that we will discuss later.
User can define environment variable.
There are two ways to define user specific environment variable manually.
1. Load variables and values from external file.
2. Enter one by one by variable name and its value.
I am describing here one way to define environment variable.
Steps:
Go to File->setting->environment tab
Select variable type to User defined
Than clik on “+” sign.
add name for e.g qtp
add value for e.g. http://quicklearnqtp.blogspot.com/
Click on apply and ok.
You can check it using following line and run it.
msgbox environment.Value(“qtp”)
You will see one msgbox with value of qtp which is “http://quicklearnqtp.blogspot.com”.
1. How to Load user defined environment variables from XML file to QTP manually and dynamically.
2. How to export user defined environment variables to any XML file manually and dynamically.
How to load user defined environment variables from file to QTP manually and dynamically?
Steps:
1. Create file named qtp.xml and write it in a following format and save it in c directory.
Load and Export User defined environment variables in QTP :
2. Go to File->setting->Environment tab.
3. select variable type to User-defined.
4. check “Load variables and values from external file” named box.
5. enter file name and path for e.g here c:\qtp.xml
6. Press apply and ok.
Now Lets talk about how to load it dynamically. You need to do following things.
1. Create one XML file described in above first step.
2. Write following line in your test script.
environment.LoadFromFile(“c:\qtp.xml”)
msgbox environment.Value(“qtp”)
After running above code You will have one message box with this content http://quicklearnqtp.blogspot.com/.
How to export user defined environment variables to any XML file manually and dynamically.
Steps:
1. Go to File->setting->Environment tab.
2. Select variable type to User-defined.
3. Press on “Export” button and give the name of file for e.g qtptest.xml
You will see all the user defined variable will be exported to qtptest.xml file( In XML format).
Now Lets talk about how to export variables to any XML file it dynamically/programmatically. You need to do following things.
Write following line in your test script.
————————————————-
environment.ExternalFileName(“c:\qtptest.xml”)
————————————————–
All user defined environment variables will be exported to qtptest.xml file.
Note: If you don’t have any user-defined variable stored in QTP. Than error will occur.

Wednesday 8 May 2019


Actions in QTP - Types of Action and Calling Actions
Actions help divide your test into logical units, A test comprises calls to actions.

Once a test is created, an action is created for the test. The Action is reusable by default. A reusable action can be called from various actions within the test or from external tests.
Creating multiple actions in test help to enhance reusability and modularize the tests. 

Types of Action:
Following are the types of Actions in QTP:
1. Reusable Actions
Can be called from multiple actions within or outside the test. An Action is reusable by default.
2. Non-reusable Actions
Cannot be called from other actions. Uncheck reusable checkbox while creating an action.
3. External Actions
This is a reusable action stored in another test.
4. Nested Action
An action called from other actions is nested action for the action from which it is called.

Calling An Action:
Action can be called in following ways: 
1. Call to Existing Action
We can view the steps of the action in the action view, but cannot modify them. The called action’s local object repository is also read-only
2. Call to Copy of Action
We can view the steps of the action in the action view and also modify the associated resources with the action. This action is non-reusable in the test.
3. Call to External Action
External actions can be called from the action by call to external action.
External Action can be called in expert view using LoadandRunAction as shown below:

LoadAndRunAction "Complete path of the test", "Name of Action"

Points to Remember about Actions
Some Important points to remember for Actions are as follows:

1. There can be maximum of 120 actions in a test.
2. For each action in a test, a new sheet in data table exists.
3. Data defined in global datasheet can be used by all the actions in the test.
4.Data defined in per action datasheet can be used by specified function only.
5. If we want to edit resources associated with a called action, use call to copy of action.
6. We can use input and output Parameter for an action, to get parameter value from an action.
7. Extension for actions is .mts
8. We can have multiple outputs from an action.



A] Inserting call to New Action


New action can be inserted at any point of time during testing by following given below steps,

Create a new action by giving safe place to buy modafinil online name Flight Finder. Right-click anywhere in the canvas to choose “Call to New Action”.

UFT Inserting call to New Action

The “Insert Call to New Action” dialog box opens, enter the Name: Flight Finder, and ensures that “Reusable Action” and “At the end of the test”both options are selected then click “OK”.

UFT Inserting call to New Action1

Once the dialog box gets closed, the Flight Finder action will add to the end of a test.User can see the modifications graphically in the test Name Tab as shown below:

UFT Inserting call to New Action2

Similarly, user can create other actions as like Flight Finder action creation process. Create action for “Select Flight” and “Book Flight”.

B] Inserting Call to Copy of Action:

Copy of an existing action can be inserted at any point of time during testing by following given below steps,
Create a copy of an existing action “Flight Finder”, right-click anywhere in the canvas to choose “Call to Copy of Action”.

UFT Call to Copy of Action

The dialog box opens to create copy of action, Select the “Test Name”, “Action Name” and also select the location the action to be inserted.

UFT Call to Copy of Action2

Once the dialog box gets closed, the copy of Flight Finder action will add to the end of a test. User can see the modification graphically in the test Name Tab as shown below:

UFT Call to Copy of Action3

C] Insert Call to Existing Action:

Existing action can be inserted at any point of time during testing by following given below steps,
In the canvas, right-click anywhere and choose “Call to existing Action”.

UFT Call to Existing Action

In the “Select Action” Window, give the test name, Action name, description and also specify the location of the action to be inserted.

UFT Call to Existing Action2

User can see the modifications graphically in the test Name Tab as shown below,

UFT Call to Existing Action3

Save the created test by clicking on “Save”.