Forum Stats

  • 3,815,470 Users
  • 2,259,032 Discussions
  • 7,893,112 Comments

Discussions

Map the parameter with dynamic value.

679279
679279 Member Posts: 61
edited Apr 21, 2009 6:23AM in QA/Testing
Hi,

can be map our variable with some dynamic values??
like suppose I have a variable in which I want to fill current value every time like current date or current time to my variable.

is there any way to customize the variable in this way?

thnx
USoni

Best Answer

  • Alex
    Alex Member Posts: 799
    USoni

    In OFT you can generate user variables by:

    Edit -> Databank Wizard -> Add Variable; then select Internal - Specify Expression as the type then you can enter Date() in the expression text field, to call the system date or Time() to call the system time.

    Unfortunately since the removal of VBA that is all OFT can do

    In OpenScript however you can use Java code view to substitute the parameter value with any Java expression, or for the date you can change the parameter value for *{{@today(MM/dd/yyyy)}}* which will return the date with the format MM/dd/yyyy, calling *{{@today(dd/mm/yyyy)}}* would return the current date with the format dd/mm/yyyy etc ...

    There is a list of pre-build functions on the help files, and if you need something that is not there and have not Java skills you can post the specific question here and I'm sure someone will post the code.

    Regards

    Alex

Answers

  • Alex
    Alex Member Posts: 799
    USoni

    In OFT you can generate user variables by:

    Edit -> Databank Wizard -> Add Variable; then select Internal - Specify Expression as the type then you can enter Date() in the expression text field, to call the system date or Time() to call the system time.

    Unfortunately since the removal of VBA that is all OFT can do

    In OpenScript however you can use Java code view to substitute the parameter value with any Java expression, or for the date you can change the parameter value for *{{@today(MM/dd/yyyy)}}* which will return the date with the format MM/dd/yyyy, calling *{{@today(dd/mm/yyyy)}}* would return the current date with the format dd/mm/yyyy etc ...

    There is a list of pre-build functions on the help files, and if you need something that is not there and have not Java skills you can post the specific question here and I'm sure someone will post the code.

    Regards

    Alex
  • 679279
    679279 Member Posts: 61
    Thanks Alex
    it was really helpfull.
This discussion has been closed.