Anda di halaman 1dari 2

QTPWorld http://www.qtpworld.com/index.php?

cid=80

Login | Search QTPWorld.com

Chapters Synchronization
Upcoming Trainings
Synchronization point is nothing but time interface between Tool and Application build.Generally Synchronization point is to
QTP Interview Questions give waiting time to the tool before executing next step in Test script.

VB Script - Part I Different methods in QTP for Synchronization:

VB Script - Part II 1. Wait statements.


2. Exist Statments.
VB Script - Part III
3. Sync Method (Only for WEB).
Working with Files using FSO
4. Inserting Synchronization points.
5. Increasing Tool default synchronization time.
Excel
Wait Statements:
Actions
Wait statements is used when we want QTP to wait for specified time, so that AUT completes its current operations.
Functions Wait(n) statement waits for specified 'n' seconds.
Wait() statement without specifying the seconds will make QTP wait up to maximum time, even though operations is
Difference between Action and completed.
Function

Parameterization Example:
Object Repository Systemutil.Run "iexplore.exe","http:\\www.gmail.com"

Descriptive Programming 'Wait for 5 sec for Gmail browser launch


Wait 5
Regular Expression
'Enter Email id in Username Field
Error Handling & Recovery Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Email"
Scenario
'Enter password in Password Field
Output Values Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Passwd"

Database Connections 'Cick on the Sign In Button


Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebButton("name:=Sign in"
Automation Object Model
Exist Statements:
Synchronization
We can enter Exist statements to instruct QuickTest to wait for a window to open or an object to appear. Exist statements
Environment Variables
return a boolean value indicating whether or not an object currently exists.
XML

Outlook Example:
Reporting Defect Systemutil.Run "iexplore.exe","http:\\www.gmail.com"

'Wait till Gmail browser exists


Do while Browser("title:=Gmail: Email from Google").Exist(1) = False
Contact Us Wait 1
Loop

info@qtpworld.com 'Enter Email id in Username Field


Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Email"
+91- 9886477710
'Enter password in Passowrd Field
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Passwd"

'Cick on the Sign In Button


Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebButton("name:=Sign in"

Sync Method: (only for WEB)

Waits for the browser to complete current navigation.

Syntax:

Object hirearchy.Sync

Example:

Systemutil.Run "iexplore.exe","http:\\www.gmail.com"

'Wait till Gmail browser launches


Browser("title:=Gmail: Email from Google").Sync

' Enter Email id in Username Field


Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Email"

'Enter password in Passowrd Field


Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Passwd"

'Cick on the Sign In Button

1 of 2 1/29/2016 9:38 AM
QTPWorld http://www.qtpworld.com/index.php?cid=80

Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebButton("name:=Sign in"

Inserting Synchronization points:

Synchronization point is nothing but time interface between Tool and Application build.Generally Synchronization point is to
give waiting time to the tool before executing next step in Test script.

Steps to follow for Inserting Syncronization points:

Position cursor in desired location-->QTP should be in recording mode-->Insert menu-->Synchronization point -->Show the
object -->click OK-->select property name and Value (True)-->enter time in Milli seconds-->click OK-->Stop recording.

Increasing Tool default synchronization time:


Default Time in QTP is 20 Seconds.

Steps to follow for Increasing default syncronization time:


File-->settings-->run tab-->increase object synchronization time out-->Apply-->OK

Copyright QTPWorld.com 2013 Home | Demo videos | Students | Training | FAQ's | Feedback | About Us Designed By WebZone

2 of 2 1/29/2016 9:38 AM