Micro Focus QTP (UFT) Forums
synchronization issue... - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: synchronization issue... (/Thread-synchronization-issue)



synchronization issue... - Freddy - 06-23-2008

Hi,

Am new in QTP...

When I run my tests from QC, sometime QTP and my web ERP get desynchronized for one test and then the remaining tests fail Sad . (For the last week all my night runs failed... not always on the same test).

What could I do to fix the pb ? (some colleagues told me to use "wait" and "synchro" but the pb still there - I added a "teardown" function that closes the all the browser windows... Tongue )

I thought that QTP would be waiting for the information/button/etc. to be displayed before it fields a field/click on button/etc... was I wrong? Do I have to handle the synchronization for every field/button with which I want to interact?

Thanks for your help.

Freddy


RE: synchronization issue... - blanchedsouza - 07-15-2008

Problem is QC overrides Tools > options > Run mode setting of QTP at the time of execution.

there are 2 solutions,
1. Either you put waitproperty statement for the object to be visible and then proceed
2. or there is generate script button, which will generate a txt or vb or qfl file. which you can associate with library files so that QC will use the settings which you have set explicitly. In one of my posts, ankur has given solution for this problem using library files. That post is in "Other" category.


RE: synchronization issue... - niranjan - 07-15-2008

Or you can use the below procedure...

' First set the browser / window object to a variable.

Code:
Set SomeBrowser = Browser("name").Page("name")
Call ToWaitUntil(SomeBrowser)

Public Sub ToWaitUntil(SomeBrowser)
      Do
          Wait 1
      Loop Until SomeBrowser.Exist(1)
End Sub

' The problem with this procedure is that if for some reason the browser remains the same, then it will become an infinite loop.... also, you can use while instead of Until.