Monday 7 December 2015

Passing current date value in a variable with SAP CBTA tool

As you know SAP CBTA is script less automation testing tool and it is required lot of CBASE understanding in order to work with custom coding.
Without touching backend code, below option reveals us how we can pass current date value during the script execution.

Below are the steps to follow:
  1. Open the recorded CBTA Script
  2. Edit the date it captured
  3. Replace hard code date value with %=day(now())&"."&month(now())&"."&year(now())%
  4. Save it and run the script
if you want to make any changes like adding 1 day/ couple of months/ year advanced date then you can simply add +1(number) next to your period.
Example:
I have to enter 2 days advance date

%=Day(Date+2)%.%=Month(Date)%.%=Year(Date)%
I have to enter 1 month advance date

%=Day(Date)%.%=Month(Date+1)%.%=Year(Date)%
I have to enter 1 year previous date
%=Day(Date)%.%=Month(Date)%.%=Year(Date-1)%

1 comment:

  1. Hi!

    This is expression tells me the today date like this 20.1.2022.

    How can i change the expression to make the date like this 20.01.2022?

    thanks in advance.

    ReplyDelete