Software QA FYI - SQAFYI

Mercury WinRunner FAQ

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31   32  33  34  35  36  37  38  39  40  41  42  43  44  45 

Q: How to get time duration in millisecond in WinRunner?

All you have to do is save the start time (get_time())
at the start and at the end of the test and then format
the difference in terms of the seconds passed between.

The code below will do what you want and more -

const SECOND = 1;
const MINUTE = 60 * SECOND;
const HOUR = MINUTE * 60;
const DAY = HOUR * 24;
const YEAR = DAY * 365;


public function dddt_CalculateDuration(in oldTime,
in newTime, out strDuration, out years, out months,
out days, out hours, out minutes, out
seconds)
{
auto timeDiff, plural = "s, ", singular = ", ", remainder;

    timeDiff = oldTime - newTime;

if(timeDiff >= YEAR)
{
    remainder = timeDiff % YEAR;
    years = (timeDiff - remainder) / YEAR;
    timeDiff = remainder;
}

if(timeDiff >= DAY)
{
    remainder = timeDiff % DAY;
    days = (timeDiff - remainder) / DAY;
    timeDiff = remainder;
}

if(timeDiff >= HOUR)
{
    remainder = timeDiff % HOUR;
    hours = (timeDiff - remainder) / HOUR;
    timeDiff = remainder;
}

if(timeDiff >= MINUTE)
{
    remainder = timeDiff % MINUTE;
    minutes = (timeDiff - remainder) / MINUTE;
    timeDiff = remainder;
}

seconds = timeDiff;

strDuration = "";

if (years)
{
    strDuration = years & " Year";
    if (years > 1)
        strDuration = strDuration & plural;
    else
        strDuration = strDuration & singular;
}

if (days)
{
    strDuration = strDuration & days & " Day";
    if (days > 1)
        strDuration = strDuration & plural;
    else
        strDuration = strDuration & singular;
}

if (hours)
{
    strDuration = strDuration & hours & " Hour";
    if (hours > 1)
        strDuration = strDuration & plural;
    else
        strDuration = strDuration & singular;
}

if (minutes)
{
 strDuration = strDuration & minutes & " Minute";
    if (minutes > 1)
        strDuration = strDuration & plural;
    else
        strDuration = strDuration & singular;
}

if (seconds)
{
 strDuration = strDuration & seconds & " Second";
    if (seconds > 1)
        strDuration = strDuration & "s.";
    else
        strDuration = strDuration & ".";
}

return E_OK;
}

Q: Working with QTP and work on web application which is developed on .Net. Trying to prepare scripts but , when record and run the script most of the liks are not recognizing by qtp,that links are dynamically generating and also into diff place. what should we do for it ?

Try changing the Web Event Recording Configurations. Go to Tools > Web Event Recording Configurations, and change the setting to high.
If the links are dynamically generated, try changing the recorded object properties. After recording, right click on the recorded object and select object properties. From this screen you can add/remove attributes for playback that were previously recorded. Focus on attributes of the object that are not specific to location and do not change (html ID maybe).


How to verify the animations(gif files) present in the applications using WinRunner?

WinRunner doesn't support testing that technology. You will need to find another tool to do that. QuickTest may be a possible choice for you. Go to the Mercury site and look at the list of supported technologies for QuickTest Pro 6.5 & above (not Astra).

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31   32  33  34  35  36  37  38  39  40  41  42  43  44  45 

Mercury WinRunner FAQ