Script for Synchronization

Write down script for synchronization which work intelligently ie it should wait only up to completion of that particular task for which we are using this sync?

Questions by baba.sqa

Showing Answers 1 - 2 of 2 Answers

a_katiyar

  • Sep 10th, 2008
 

In case of WinRunner we can use different synchronization functions based on requirements:
These functions waits for the current property value to match with the expected value, until the given time expires.
If property value matches much before the given time it will continue to next step instead of waiting for the maximum given time (similer what "wait()" function do).

For example:
       button_wait_info(button,property,exp_value,max_time);

This function waits for the button 'property' value to match with 'exp_value' and continue executing next steps, In case property does not match it will wait until 'max_time' expires.
 ###########################

In case you don't know the time limit, and you don't want to continue untile property matches, then you can use steps similer to given below::
do
{
         button_get_info(button,property,ret_value);
         if (ret_value == exp_value)
         {
              report_msg("Property matches;continue with next steps");
              break;
          }
}
while(TRUE);
#Note: if value do not matches this loop will execute infinite times, so always prefer to have some measurement criteria.

Best Regards,
-AK

monogeo

  • Jul 8th, 2009
 

To make the wait time more intelligent, I create a function to constantly collect the wait time or network delay from previous actions, calculate the global wait time dynamically based on business logic, then return the best wait time.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions