Overriding Date Settings - WinRunner

As you debug your tests, you may want to override how WinRunner identifies or ages specific date fields in your application. You can override the following:

  • Aging of a specific date format. You can define that a specific date format (for example, MM/DD/YY) will be aged differently than the default aging applied to other date formats.
  • Aging or date format of a specific object. You can define that a specific object that resembles a date (for example, a catalog number such as 123172) will not be treated as a date object. You can specify that a specific date object (such as a birth date) will not be aged. Or, you can define that a specific object will be assigned a different date format than that of the default.

Overriding Aging of Specific Date Formats

You can override the aging of a specific date format so that it will be aged differently than the default aging setting.

To override the aging of a date format:

  1. Choose Tools > Date > Set Date Formats. The Set Date Formats dialog box opens.

    Overriding Aging of Specific Date Formats

  2. Click the Advanced button. The Advanced Settings dialog box opens.

    Overriding Aging of Specific Date Formats

  3. In the Format list, select a date format.
  4. Note that the Format list displays only the date formats that are checked in the Set Date Formats dialog box.

  5. Click Change. The Override Aging dialog box opens.
  6. Override Aging dialog box opens

  7. Clear the Use default aging check box and select one of the following:
    • To increment the date format by a specific number of years, months, and days, select the Add to recorded date option. To specify no aging for the date format, use the default value of 0.
    • To choose a specific date for the selected date format, select Change all dates to, and choose a date from the list.
  8. Click OK to close the Override Aging dialog box.

Overriding Aging or Date Format of an Object

For any specific object, you can override the default settings and specify that:

  • the object should not be treated like a date object
  • the object should be aged differently
  • the object should be converted to a different date format

To override settings for an object:

  1. Choose Tools > Date > Override Object Settings. The Override Object Settings dialog box opens.
  2. To override settings for an object

  3. Click the pointing hand button and then click the date object.
  4. WinRunner displays the name of the selected date object in the Object Name box.

  5. To override date format settings or to specify that the object is not a date object, clear the Use default format conversion check box and do one of the following:
    • To specify that the object should not be treated like a date object, select Not a date in the Original date format field and in the New date format field.
    • To override the date format assigned to the object, select the object’s original date format and its new date format in the respective fields.
  6. To override the aging applied to the object, click Change. The Override Aging dialog box opens.
  7. Override Aging dialog box opens.

  8. Clear the Use default aging check box and do one of the following:
    • To increment the date format by a specific number of years, months, and days, select the Add to recorded date option. To specify no aging for the date format, use the default value of 0.
    • To choose a specific date for the selected date format, select Change all dates to, and choose a date from the list.
  9. Click OK to close the Override Aging dialog box.
  10. In the Override Object Settings dialog box, click Apply to override additional date objects, or click OK to close the dialog box.

Overriding Date Formats and Aging with TSL

You can override dates in a test script using the following TSL functions:

  • The date_age_string function ages a date string. It has the following syntax:

    date_age_string ( date, years, month, days, output );

  • The date_align_day function ages dates to a specified day of the week or type of day. It has the following syntax:

    date_align_day ( align_mode, day_in_week );

  • The date_change_original_new_formats function overrides the date format for a date object. It has the following syntax:

    date_change_original_new_formats ( object_name, original_format,new format [ , TRUE/FALSE ];

  • The date_change_field_aging function overrides the aging applied to the specified date object. It has the following syntax:

    date_change_field_aging ( field_name, aging_type, days, months, years );

  • The date_set_aging function ages the test script. It has the following syntax:

    date_set_aging ( format, type, days, months, years );

  • The date_set_system_date function sets the system date and time. It has the following syntax:

    date_set_system_date ( year, month, day [ , day, minute, second ] );

  • The date_type_mode function disables overriding of automatic date recognition for all date objects in a GUI application. It has the following syntax:

    date_type_mode ( mode );


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics