Book demo
Start trial

The LEAP

Automation insights and productivity tips from LEAPWORK.

All Posts

How to Use Dates and Times in Test Automation

Dates and timestamps are important in most test automation scenarios. For instance, when testing user sign-up flows, entering a birthday or social security number is often required. Or when validating expiration dates during web content testing, generating a date/time value exactly one week from today might be needed.

Working with dates and timestamps in LEAPWORK is very easy and flexible, using the Generate date/time, Offset date/time and Set date/time building blocks. Here's a simple example of how to get today's date and then add one year to it:

Get today's date and offset by a year using LEAPWORK

Below is another example in LEAPWORK, which generates a date that is the first day of a random month in the year 2016:

Get first day of a random month in the year 2016 using LEAPWORK

Claus Topholt
Claus Topholt
CTO and co-founder of LEAPWORK.

Related Posts

How to Achieve Agile Testing by Automating Functional UI Tests

Agile transformation and testing Agile transformation helps businesses manage change and pursue emerging opportunities in any market situation. A key ingredient of this approach is to implement agile testing.

How Test Automation Supports Agile Transformation

Agility in IT processes In a world where new business models are disrupting established revenue streams and expectations to the customer experience are constantly increasing, businesses everywhere are struggling to stay relevant. To stay competitive requires efficiency: Fast market adaptation, well-organized change management, and the ability to secure emerging opportunities. One of the ways to get there is through agile transformation.

Getting Started with Test Automation

When implementing test automation there are several things to consider, including: how much can we automate? which tool is right for us? can we justify the initial investment of time and effort? and much more.