SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jan 2003
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Assign system date

    How to assign system date to a field?

    After recording my script I got following statement :

    set_window("Content",10);
    edit_set("StartDte","08/25/2003");

    Now as a part of the testing requirement I am suppose to enter today's date on "StartDte" field. How to do that? I was expecting something like below :

    set_window("Content",10);
    edit_set("StartDte",sysdate());

    But getting undefined function error. Please help. Thanks in advance.

  2. #2
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Assign system date

    Take a look at the time_str() function along with the substr() function.
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

  3. #3
    Junior Member
    Join Date
    Jan 2003
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Assign system date

    Thanks Charles. I need another little help. What is equivalent function of

    to_date(date_var,"mm/dd/yyyy")

    in Winrunner? I have used following statement

    set_window("Content",10);
    edit_set("StartDte",substr(time_str(get_time()),5, 7) & substr(time_str(get_time()),21,4));

    and now getting "Aug 28 2003" assigned to that field. Now I guess I just need to format it to "mm/dd/yyyy" format. Any help would be highly appreciated.

  4. #4
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Assign system date

    There is no built-in function. You'll have to write your own; or do some searches here, at the Mercury support site, Yahoo WinRunner group, etc. to download something. Hint: look at the MI support site under the user uploads for the date functions uploaded by Jordan Gottlieb (co-authored by me). If you write your own, you may find split() useful as another way to get the values out of the results of time_str(), and sprintf() for formatting the string you need.
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 7.69%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:52 PM.

Copyright BetaSoft Inc.