QTP/UFT – QeWorks http://qeworks.com Software Testing Learning Hub Sun, 29 Oct 2017 14:38:18 +0000 en-US hourly 1 Synchronization in UFT http://qeworks.com/synchronization-in-uft/ Sat, 27 Feb 2016 17:27:45 +0000 http://qeworks.com/?p=5480 When we automate the script most of the time we faced several issues with performance of application. sometimes application becomes slow in response sometimes fast. then how we show make sure that our script should run in irrespective of the application performance and response? all automation tools provide specific functions which handles these performance issue. […]

The post Synchronization in UFT appeared first on QeWorks.

]]>
When we automate the script most of the time we faced several issues with performance of application. sometimes application becomes slow in response sometimes fast. then how we show make sure that our script should run in irrespective of the application performance and response?

all automation tools provide specific functions which handles these performance issue. UFT also has Synchronization mechanism to make sure that script will not fail.

Lets discuss more about the Synchronization.

there are 5 different ways to handle the synchronization.

  • WaitProperty
  • Exist
  • Wait
  • Sync(only for web based apps)
  • Default Synchronization

 

lets discuss it one by one.

WaitProperty

WaitProperty is a method  which can be apply on any object in UFT. It takes the property name, Value and Timeout value as input to perform the sync. It is a dynamic wait, it means once the object is get visible/enable or state becomes true corresponding action gets performed. so it is highly recommended options.

Example : lets put wait for 10secs

Dim obj
Set obj = Browser("mainpage").Page("form1")
obj.Link("select").Click
obj.Link("Select Country").WaitProperty "text", "Simple Interest",10000
obj.Link("Select Country").Click

Exist

Exist menthod ensure that object is present on the screen or not. Exist is a method that takes the Timeout value as input to perform the sync.  it is a dynamic wait similar to Waitproperty and hence this option is also recommended.

Dim obj
Set obj = Browser("mainpage").Page("form1")
obj.Link("select").Click
If obj.Link("Select Country").Exist(30) Then
obj.Link("Select Country").Click
Else
Print "object does not exists";
End If

 

Wait

Wait  Method puts hardstop on wait. if you use this method then thread of execution will stop for defined set value.this wait method is not recommended unless you don’t have another option.

Dim obj
Set obj = Browser("mainpage").Page("form1")
obj.Link("select").Click
wait(30)
obj.Link("Select Country").Click

 

Sync Method

sometimes pageload time varies. to wait for it Sync method can be used. Method can be used only for web applications where there is always a lag between page loads.

Dim obj
Set obj = Browser("mainpage").Page("form1")
obj.Link("select").Click
wait(30)
obj.Link("Select Country").Sync


Default Synchronization:

When user hasn’t used any of the above sync methods, still QTP has inbuild Object synchronization timeout which can be adjusted by the user.

Synchronization in UFT
Synchronization in UFT

Navigate to “File” >> “Settings” >> Run Tab >> Object Synchronization Time out as shown below.

 

More topics on UFT you can find in UFT section 

The post Synchronization in UFT appeared first on QeWorks.

]]>
Descripting programming in UFT http://qeworks.com/descripting-programming-in-uft/ Mon, 20 Jul 2015 11:06:49 +0000 http://qeworks.com/?p=5276 With variety of technologies and complex application architecture, it is not always possible to identify the each and every object and stored in Object repository. Descriptive programming is of most effective way define the object run time and perform action on it. There are two ways to script using Descriptive Programming programming. Description Objects : […]

The post Descripting programming in UFT appeared first on QeWorks.

]]>
With variety of technologies and complex application architecture, it is not always possible to identify the each and every object and stored in Object repository. Descriptive programming is of most effective way define the object run time and perform action on it.
There are two ways to script using Descriptive Programming programming.

Description Objects : Creation of object and use it in the code
Description Strings : create the String and use it inside the code without creation of object. (not much recommended due more script maintenance)

 

Description Objects :

Step1 : Creation of object

‘Define object:

Set btnLogin= Description.Create()

Step 2: Add properties to object Created

btnLogin("type").value = "Button"
btnLogin("name").value = "Login"
btnLogin("html tag").value = "INPUT"

Step 3: Use the object in Script

Browser("LoginPage").Page("Login").WebButton(btnLogin).Click

Description Strings

in this option you can form string and use directly in your code without object creation

Browser("LoginPage").Page("Login").WebButton("html tag:=INPUT","type:=Button","name:=Login").Click

The post Descripting programming in UFT appeared first on QeWorks.

]]>
Registry Editor in QTP http://qeworks.com/registry-editor-in-qtp/ Fri, 12 Jun 2015 16:13:43 +0000 http://qeworks.com/?p=2714 QTP allows to create and edit a key values of registry.Registry handling is possible by using a wscript. shell object. Refer a following code to add/edit registry values Dim wshshell,companyname,emp1name set wshshell=Createobject(“Wscript.shell”) wshshell.RegWrite “HKEY_CURRENT_USER\Software\Company”,”Lion”,”Reg_SZ” /* This will create a key in registry with the name company and add Lion as key with Reg_SZ key type *\ […]

The post Registry Editor in QTP appeared first on QeWorks.

]]>
registry_editorQTP allows to create and edit a key values of registry.Registry handling is possible by using a wscript. shell object.

Refer a following code to add/edit registry values

Dim wshshell,companyname,emp1name

set wshshell=Createobject(“Wscript.shell”)

wshshell.RegWrite “HKEY_CURRENT_USER\Software\Company”,”Lion”,”Reg_SZ”

/* This will create a key in registry with the name company and add Lion as key with Reg_SZ key type *\

wshshell.RegWrite “HKEY_CURRENT_USER\Software\Company\Emp1″,”JOHN”,”Reg_SZ”

companyname=wshshell.RegRead(“HKCU\software\company\”)

emp1name=wshshell.RegRead(“HKCU\software\company\emp1”)

wshshell.RegDelete “HKCU\software\company\emp1”

wshshell.RegDelete “HKCU\software\company\”

Root key names in Registry-

Hkey_current_user HKCU
HKey_LOCAL_MACHINE HKLM
HKEY_CLASSES_ROOT HKCR
HKEY_USERS HKEY_USERS
HKEY_Current_CONFIG HKEY_Current_CONFIG

 Datatypes in Registry

Name of variables Datatypes
REG_SZ String
REG_DWord Number
REG_BINARY Binary value
REG_EXPAND_SZ Dynamic string

The post Registry Editor in QTP appeared first on QeWorks.

]]>
Sub-Procedure and Functions in QTP http://qeworks.com/sub-procedure-and-functions-in-qtp/ Fri, 13 Mar 2015 21:23:50 +0000 http://qeworks.com/?p=2634 Sub-Procedure: A Sub procedure can be defined as a series of statements enclosed by sub and end sub.Sub-procedure is used to perform actions but does not return any value.Sub-procedure can accept parameters from caller of that sub-procedure. Refer below syntax – Public Sub Demo_sub() Print “Call this QeWorks Procedure” End Sub or Public Sub Demo_sub1(argument1,argument2) […]

The post Sub-Procedure and Functions in QTP appeared first on QeWorks.

]]>

Sub-Procedure:

A Sub procedure can be defined as a series of statements enclosed by sub and end sub.Sub-procedure is used to perform actions but does not return any value.Sub-procedure can accept parameters from caller of that sub-procedure.

Refer below syntax –

Public Sub Demo_sub()
Print “Call this QeWorks Procedure”
End Sub

or

Public Sub Demo_sub1(argument1,argument2)
Print “Call this QeWorks Procedure by passing parameters”
End Sub

Method to call Sub-procedure

Call Demo_sub1(argument1,argument2)

call Demo_sub()

Function:

A Function can be defined as s a series of statements, enclosed by the Function and End Function statements.Function s used to perform actions but can return a value.Function can accept parameters from caller of that Function.

Refer Below syntax-

Public Function myfunction()
Print “QeWorks-my function”
End Function

or

Public Function myfunction1(a,b)
myfunction1=a+b  ‘method to return a value
End Function
Method call Function Procedures: Call myfunction

abc=myfunction1(argument1,argument2)

Procedure and functions are used to write the commonly used executable scipts. It helps to reduce the number of lines of code.

The post Sub-Procedure and Functions in QTP appeared first on QeWorks.

]]>
UFT Lesson 1- Introduction to UFT 11.5 – UFT Installation Process http://qeworks.com/uft-lesson-1-introduction-to-uft-11-5-uft-installation-process/ http://qeworks.com/uft-lesson-1-introduction-to-uft-11-5-uft-installation-process/#comments Tue, 24 Jun 2014 13:09:37 +0000 http://qeworks.com/?p=4477 In this Part of the lesson no 1, we are going to look at installation of UFT 11.5 Trail Version.   Step 1 : Down the Trail Version from HP website.  Download UFT Trial Step 2: Extract the Zip File   Step 3:  Run UFT Setup and Select Unified Functional Testing Setup.   Step 4:  You will […]

The post UFT Lesson 1- Introduction to UFT 11.5 – UFT Installation Process appeared first on QeWorks.

]]>
Lesson 1 -installation

In this Part of the lesson no 1, we are going to look at installation of UFT 11.5 Trail Version.

 

Step 1 : Down the Trail Version from HP website.  Download UFT Trial

Step 2: Extract the Zip File

step 1 -extract zip

 

Step 3:  Run UFT Setup and Select Unified Functional Testing Setup.

Step 2- select unified functional testing setup

 

Step 4:  You will get the Welcome Screen, Click on Next Button to continue.

Step 3 - Welcome Screen - Click Next

 

 

Step 5:   Accept License Agreement and click on Next button.

Step 4- accept Terms and conditions

 

Step 6: Enter your information.

Step 5 - enter your details

 

Step 7: Custom Setup, if you want to perform custom setup then use configure your setup else click on Next.

Step 6 - Custom Setup

Step 8: Select the UFT installation Location.

step 7 - installation path

Step 9: Confirm the installation. It will start installing UFT on your machine.

Step 9 - installation progress

 

Step 10:  Installation is in progress

Step 8 - Confirmation

 

Step 11: Complete installation

Step 10 - Finish

Step 12: Additional installation Requirement. for trial, do not select Run license installation wizard.

Step 11 - Additional resources

 

Step 13: Complete installation. you are set to Run the UFT on your Machine

 

If you have any queries regarding the UFT installation, feel free to contact us, by just replying to this post.

The post UFT Lesson 1- Introduction to UFT 11.5 – UFT Installation Process appeared first on QeWorks.

]]>
http://qeworks.com/uft-lesson-1-introduction-to-uft-11-5-uft-installation-process/feed/ 1
UFT Lesson 1- Introduction to UFT 11.5 – Brief Introduction and History http://qeworks.com/uft-lesson-1-introduction-to-uft-11-5-brief-introduction-and-history/ Tue, 24 Jun 2014 12:02:58 +0000 http://qeworks.com/?p=4472   HP Unified Functional Testing (UFT) software, formerly known as HP QuickTest Professional (QTP). It is most famous automation tool to automate UI and API /Web service testing. This Tool automate the manual Regression Test packs and APIs / Web services of an application. It reduces the manual interventions and save cost, time and give consistent results. […]

The post UFT Lesson 1- Introduction to UFT 11.5 – Brief Introduction and History appeared first on QeWorks.

]]>
 

What is UFT 11.5

UFTHP Unified Functional Testing (UFT) software, formerly known as HP QuickTest Professional (QTP). It is most famous automation tool to automate UI and API /Web service testing. This Tool automate the manual Regression Test packs and APIs / Web services of an application. It reduces the manual interventions and save cost, time and give consistent results.

UFT/QTP is an HP product and has good integration with HP quality center which makes UFT as complete automation solution for software testing.

HP Unified Functional Testing supports keyword and scripting approaches to automate the User interfaces and features.

It uses the Visual Basic Scripting Edition (VBScript) scripting language to specify a test procedure, and to manipulate the objects and controls of the application under test.

History:

HP Unified Functional Testing was originally Developed by Mercury Interactive and called QuickTest Professional.Mercury Interactive was subsequently acquired by Hewlett Packard(HP) in 2006. HP Unified Functional Testing 11.5 combined HP QuickTest Professional and HP Service Test into a single software package, which is currently available from the HP Software Division. The integrated HP Unified Functional Testing software allows developers to test from a single console all three layers of a program’s operations: the interface, the service layer and the database layer.

The post UFT Lesson 1- Introduction to UFT 11.5 – Brief Introduction and History appeared first on QeWorks.

]]>
UFT 11.5 Learning Series. http://qeworks.com/uft11-5-learning-series/ Fri, 13 Jun 2014 18:22:05 +0000 http://qeworks.com/?p=4228 Welcome to Series of posts to learn UFT 11.5  Step by Step. this series of posts will teach step by step UFT (formerly known as QTP) from basic topics to advance. it will also includes the Sample code snippets which can be used as reference. Soon you will find the links on following topics…. Stay tuned…. Lesson 1 […]

The post UFT 11.5 Learning Series. appeared first on QeWorks.

]]>
UFT11.5 Learing Series

Welcome to Series of posts to learn UFT 11.5  Step by Step. this series of posts will teach step by step UFT (formerly known as QTP) from basic topics to advance. it will also includes the Sample code snippets which can be used as reference.

Soon you will find the links on following topics….

Stay tuned….

Lesson 1 :  Introduction to UFT 11.5:

  • History of Quick Test Professional.
  • UFT installation process.
  • New features added to UFT 11.5.
  • Supporting Environments.
  • License types.
  • Starting Quick Test window.
  • Add in Manager window.

Lesson 2: IDE:

  • Solution Explorer.
  • How to create GUI test.
  • How to create API test.
  • How to add action to the test.
  • Editing multiple actions/tests.
  • Canvas.

Lesson 3: Key Features of QTP UFT IDE:

  • Test Pane (Keyword View/Expert View).
  • Active Screen.
  • Data Table.
  • Debug Viewer.
  • Missing resources.
  • Information.

Lesson 4: UFT Test Automation process:

  • Test planning/Create the environment.
  • Recording/Create the basic test.
  • Enhancing the script.
  • Debugging the script.
  • Running the script.
  • Analyze the Test results.
  • Reporting the defects.

Lesson 5: Record and Playback:

  • Creating and executing a basic test.
  • Recording a test.
  • Understanding the recorded test.
  • Running a test.
  • Recording modes.
  • Normal recording.
  • Analog recording.
  • Low level recording.
  • Insight Recording.
  • Analyze QTP Test Results window.

Lesson 6: Types of Object in QTP UFT:

  • Test Object.
  • Run Time object.
  • Utility objects

Lesson 7: Object Repository

Object repository:

    • Local repository.
    • Shared repository.

Working with Object Repository:

    • How Quick Test identifies Objects.
    • Working with Test Objects.
      • i. Object Repository Introduction
      • ii. Identifying the Object
      • iii.Highlighting the object
      • iv.Viewing the Object’s Properties
    •  Add the objects to OR manually.
    • Object Spy.
    • Managing Object Repositories.
    • Merging Shared Object Repositories.
    • Associating Shared Object Repositories to a Test.

Object Identification Mechanism:

    • Configuring Object Identification.
    • Smart Identification mechanism.
    • Ordinal Identifiers.
    • Image based object Identification.

 

Lesson 8: Introduction to VbScript:

  •  VB Script Language Overview.
  • VB Script Data Types.
  • VB Script Variables.
  • Comments.
  • Operators.
  • Conditional statements (If and Select).
  • Loops (For, Do While, Do Until).
  • Functions.
  • Coding standards.
  • Naming conventions.

 

Lesson 9: Checkpoints:

  •  Checkpoint Introduction.
  • Adding Checkpoints to a Test.
    • Adding Checkpoint while Recording
    • Adding Checkpoint while Editing
  • Types of Checkpoints.
  • Standard Checkpoint.
  • Text Checkpoint.
  • Text Area Checkpoint.
  • Bitmap Checkpoint.
  • Database Checkpoint.
  • Accessibility Checkpoint.
  • XML Checkpoint (From Application).
  • XML Checkpoint (From Resource).
  • Page Checkpoint.
  • Image Checkpoint.
  • Table Checkpoint.
  • File Checkpoint.

Lesson 10: Output values:

  •  Output value Introduction.
  • Adding Output value to a Test.

i. Adding Checkpoint while Recording

ii. Adding Checkpoint while Editing

  • Types of Output value

i. Standard Output value
ii. Text Output value
iii. Text Area Output value
iv. Database Output value
v. XML Output value (From Application)
vi. XML Output value (From Resource)

 

Lesson 11: Working with Data tables:

  • Introduction to Data tables.
  • Working with Global and Action sheets.
  • Importing and Exporting data.
  • Working with Data Table methods.

 

Lesson 12: Working with Environment variables:

  •  Built-in Variables.
  • User Defined Variables.
  • Defining, modifying and associating environment variables.
  • Loading Environment file during run-time.

Lesson 13: Parameterization:

  •  Introduction to Parameterization.
  • Parameterizing using Data table.
  • Parameterizing using Environment variables.
  • Parameterizing using random numbers.

Lesson 14: Actions:

  •  Types of actions
    •  Non-reusable Actions
    • Re-Usable actions
    • External Actions
  • Creating an Action.
  • Splitting Actions.
  • Renaming an Action.
  • Deleting an Action.
  • Making an Reusable/Non-Reusable.
  • Calling an existing Action.
  • Copying an Actions.
  • Action Parameters.

Lesson 15: Synchronization & Transactions:

Synchronizing the tests:

i. Adding wait statement
ii. Adding Exist statement
iii. Inserting Synchronization point

Transactions:

  • Start Transaction
  • End Transaction

Lesson 16: Regular Expressions:

  • Introduction to Regular Expressions.
  • Handling Dynamic objects.
  • Defining Regular expressions.
  • Running and analyzing a test with Regular Expressions.

Lesson 17: Recovery Scenarios:

  •  Introduction to Recovery Scenarios.
  • When to use Recovery Scenarios.
  • Defining Recovery Scenarios.
  • Recovery Scenario Manager.
  • Managing Recovery Scenarios.
  • Associating Recovery Scenarios to your Test.

 

Lesson 18: Debugging techniques:

  •  Inserting/Removing Break points.
  • Watch/ variable.
  • Step by step execution.
  • Call Stack.
  • Loaded Modules.
  • Threads.

Lesson 19: Descriptive Programming:

  • Advantages of Descriptive Programming.
  • Handling Dynamic objects.
  • Getting child objects.
  • Create a script using both OR and DP for an application.

Lesson 20: Automation Object Model:

  • Working with Excel.
  • Working with keyboard.
  • Working with mouse.
  • Working with QTP object.

Lesson 21: Working with File System Object:

Lesson 22: Error Handling:

  •  On Error Resume Next.
  • On Error Go to.

Lesson 23: Automation Frameworks:

  •  Introduction to Framework.
  • Overview of the Frameworks.
    • Modularity Framework
    • Keyword-Driven Framework
    • Data-Driven Framework
    • Hybrid Framework

API Testing

 

Lesson 24: QTP UFT API testing:

  •  What is SOA?
  • Why automation required for SOA?
  • Understanding the terminology
  • Sample application
  • How to invoke the application

Lesson 25: Build a simple API test:

  •  Create a new API test.
  • Create a new test step.
  • Connect test steps.
  • Map data from multiple sources.
  • Drive the PI test step.

Lesson 26: Test a web service:

  •  What is web service?
  • Different kind of web services
  • Import a Web service
  • Build a Web service test
  • Integrate data into a test
  • Use multiple data sources and custom code

Lesson 27: Test Rest services:

  •  What is Rest service?
  • Create a REST service activity
  • Run a REST test
  • Assign data to REST method
  • Check my output
  • Resolve changes in REST service
  • Mobile Application testing support
  • What is mobile application?
  • What is perfecto/see test plugin?
  • Record and playback a mobile application

The post UFT 11.5 Learning Series. appeared first on QeWorks.

]]>
Object Repository Manager and Functions of Object Repository manager http://qeworks.com/object-repository-manager-and-functions-of-object-repository-manager/ Thu, 07 Nov 2013 12:30:57 +0000 http://qeworks.com/?p=2498 The Object Repository Manager enables you to manage all of the shared object repositories used in your organization from a single, central location, including adding and defining objects, modifying objects and their descriptions, parameterizing repositories to make them more generic, maintaining and organizing repositories, merging repositories, and importing and exporting repositories in XML format.We can […]

The post Object Repository Manager and Functions of Object Repository manager appeared first on QeWorks.

]]>
The Object Repository Manager enables you to manage all of the shared object repositories used in your organization from a single, central location, including adding and defining objects, modifying objects and their descriptions, parameterizing repositories to make them more generic, maintaining and organizing repositories, merging repositories, and importing and exporting repositories in XML format.We can launch object repository manager from QTP menu-

Resources > Object Repository Manager

rm1

Object Repository manager performs and monitors various functions like

  • Add Objects
  • Update Objects
  • Delete Objects
  • Merging Object Repositories

We will see the functions of object repository manager in detail

Add Objects-

An object can be added to the local object repository by using any of the following ways:

1. Record some actions on the object,this will automatically add this object to the object repository. If you do not need the recorded statements in your script, you can delete them and it will not remove the added object from the object repository.

2. Add objects manually.

Click on Resources->Object Repository.
In the Filter combobox, select “Local Objects”.
Go to Object -> Add Objects to Local.
Click on the object to be added to the repository.
If the Object Selection window appears, select the desired object, and click on OK button.

Update Objects-

QTP enables you to maintain the reusability of your test objects by storing all the information regarding your test objects in a object repository. When objects in your application change, the Object Repository Manager provides a single, central location in which you can update test object information for multiple tests.

To modify the test object properties You have to use Object Repository Manager
Click on Resources -> Object Repository Manager .Open the Object repository from which you want to edit a object property
Repository gets opened in Read-only mode. To enable editing click File -> Enable Editing
Once editing is enabled you can perform modifications on the test objects

Delete Objects-

Object manager allows to delete the object from local as well as from shared object repository.

To  select the object you want to delete.
Click on the Delete button or select Edit-Delete button.
Click on Yes to confirm that you want to delete that object.

Object repository is the most commonly used feature in QTP.

The post Object Repository Manager and Functions of Object Repository manager appeared first on QeWorks.

]]>
Web Table in QTP http://qeworks.com/web-table-in-qtp/ http://qeworks.com/web-table-in-qtp/#comments Mon, 08 Jul 2013 11:37:13 +0000 http://qeworks.com/?p=2710 QTP helps to identify by providing Web table class. WebTable class provides various methods to work on web table. In this post we will look at the Methods and Examples to use them. Webtable class contains various methods which allows to work on tabular structure.Tables inside web pages are implemented without any name or id […]

The post Web Table in QTP appeared first on QeWorks.

]]>
webtable

QTP helps to identify by providing Web table class. WebTable class provides various methods to work on web table. In this post we will look at the Methods and Examples to use them. Webtable class contains various methods which allows to work on tabular structure.Tables inside web pages are implemented without any name or id attributes most of the times. This makes it difficult for Automation engineer to create robust scripts for identifying the Table correctly at run-time. QTP by default uses the “index” ordinal identifier to recognized a WebTable.

 

 

Methods:

ChildItem
Returns a test object from the cell by type and index
Ex:

Set ChildItem = Browser("BrowserName").Page("PageName").WebTable("html
tag:=TABLE").ChildItem(2,1,"WebCheckBox",0)
ChildItem.Click

 

‘we have to pass row number, column number, Object type and Index(optional)

ChildItemCount
Returns the count of objects of a specific type in the specified cell.
Ex:

ChildItemCount=Browser("Browser").Page("Page").WebTable("html
tag:=TABLE").ChildItemCount(2,1,"WebCheckBox")
Msgbox ChildItemCount

 

ChildObjects
Returns the collecton of Child Objects Contained within the Object.
Ex:

Set ChildObject = Browser("Browser").Page("Page").WebTable("html
tag:=TABLE").ChildObjects
Msgbox ChildObject.Count

For i=1 to ChildObject.Count
msgbox i&" "& ChildObject(i).GetRoProperty("name")
Next

 

RowCount
Returns the number of rows in the table.

RowCount=Browser("Browser").Page("Page").WebTable("html tag:=TABLE").RowCount
Msgbox RowCount

 

ColumnCount
Returns the number of column in the table.
Ex:

ColumnCount = Browser("Browser").Page("Page").WebTable("html
tag:=TABLE").ColumnCount(2)
Msgbox ColumnCount

Note: we need to pass rownumber to know the column count

GetCellData
Returns the text contained in the specified cell.
Ex:

CellData = Browser("Browser").Page("Page").WebTable("html
tag:=TABLE").GetCellData(1,1)
Msgbox CellData

 

GetRowWithCellText
Returns the number of the first row found that contains a cell with the specified text.
Ex:

Msgbox Browser("Browser").Page("Page").WebTable("html
tag:=TABLE").GetRowWithCellText("Hello")

 


Refer the below sample code to work/handle a Web table.

rc =Browser("E-HRIS view employees").page("E-HRIS view employees").webtable("name:= Webtable_edit").Rowcount

'Above  rowcount property will return a integer of the total number of rows in web table.

msgbox rc

cc=Browser("E-HRIS view employees").page("E-HRIS view employees").webtable("name:= Webtable_edit").Columncount

msgbox cc

Webtable data validation-

Refer a below code to check or retrieve a data

Dim colref,actref

for c=1 to cc

if  trim(lcase  ( Browser( "E-HRIS view employees" ).page( "E-HRIS view employees" ).webtable( "name:= Webtable_edit" ).

getcellData(1,c)))="designation") then

msgbox c

End if

next

 

The post Web Table in QTP appeared first on QeWorks.

]]>
http://qeworks.com/web-table-in-qtp/feed/ 1
Smart identification in QTP http://qeworks.com/smart-identification-in-qtp/ Tue, 25 Jun 2013 18:01:35 +0000 http://qeworks.com/?p=2460 When We talk about the Object identification in QTP. the object identification is done on Windows handle. it means, in object repository we store the mapping of the actual windows handle of the object and during executing the test this mapping is used to identify the same element and perform desired action on it. When […]

The post Smart identification in QTP appeared first on QeWorks.

]]>
When We talk about the Object identification in QTP. the object identification is done on Windows handle. it means, in object repository we store the mapping of the actual windows handle of the object and during executing the test this mapping is used to identify the same element and perform desired action on it.

When QTP uses the recorded description to identify an object, it searches for an object that matches with property values in the description. In most cases, this description is the simplest way to identify the object and unless the main properties of the object change, this method will work.

Smart Identification is used by QTP, whenever it is unable to identify any object during run time. While identifying an object, QTP tries to match the mandatory properties first, if it couldn’t find the object, then it adds assertive properties one by one to identify the object correctly. This operation is done by smart identifier and it is displayed in the results section along with one warning message. It’s generally used to identify Web elements only.

The Smart Identification mechanism uses two types of properties:
Base filter properties—Properties of a particular test object class, those whose values cannot be changed without changing the essence of the original object
Optional filter properties—Other properties that can help to identify test objects of a particular class as they are unlikely to change on a regular basis

The post Smart identification in QTP appeared first on QeWorks.

]]>