Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How to put synchronization point in qtp? Why we use synchronization?




252
views
asked marvit August 13, 2014 09:44 AM  

How to put synchronization point in qtp? Why we use synchronization?


           

1 Answers



 
answered By Dharma   0  
Different way we can put Synchronization Point  in QTP:

1. Wait statements.
2. Exist Statments.
3. Sync Method (Only for WEB).
4. Inserting Synchronization points.
5. Increasing Tool default synchronization time.

Wait Statements:

  • Wait statements is used when we want QTP to wait for specified time, so that AUT completes its current operations.
  • 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 completed.

Example


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

 

'Wait for 5 sec for Gmail browser launch

Wait 5

 

'Enter Email id in Username Field

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

 

'Enter password in Password Field

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

 

'Cick on the Sign In Button 

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


Exist Statements:

We can enter Exist statements to instruct QuickTest to wait for a window to open or an object to appear. Exist statements return a boolean value indicating whether or not an object currently exists.
Example:


Example



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

 

'Wait till Gmail browser exists

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

 

Wait 1

Loop

 

'Enter Email id in Username Field

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

 

'Enter password in Passowrd Field

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

 

'Cick on the Sign In Button 

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

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").Set "qtpworld.com"

 

'Enter password in Passowrd Field

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

 

'Cick on the Sign In Button 

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


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

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert