• Use Cases
    • Type
      • EnterpriseHigh traffic websites with advanced functionality, such as booking, browsing or paying.
      • Small/MediumWebsites with low-mid traffic that have one or more key functionalities including checkout, sign-ups or account login.
      • AgenciesAgenciesWeb agencies that help clients build, maintain and improve their websites.
    • Industry
      • eCommerce
      • Travel
      • Gambling
      • Public Sector
    • Team
      • Technical
      • Digital
  • Platform
    • Platform
      • PerformanceRapidSpike’s performance tools help you improve website speed, so you can boost conversions and keep customers coming back.
      • SecurityProtection for your business and your customers from web skimming and form jacking attacks, and more
      • ReliabilityCustomer complaints can drive away future business. It’s vital you find, fix and prevent any issues fast.
    • Top Features
      • User Journeys
      • Magecart Attack Detection
      • Core Web Vitals Monitoring
      • Uptime
      • Alerting & Integrations
    • Take a guided tourLearn how RapidSpike can support your business today.
  • Customers
  • Learn
    • Learn
      • BlogNews updates and articles about web monitoring.
      • Knowledge BaseDocumentation and other resources for customers.
      • RapidSpike AcademyTraining courses and guided tutorials.
      • About UsWe help make the web faster, safer and easier to use.
      • PressSee what the press are saying about RapidSpike.
    • From The Blog
      • How RapidSpike Cookie Monitoring Can Support Managing GDPRHow RapidSpike Cookie Monitoring Can Support Managing GDPR
      • Using RapidSpike to Support PCI DSS 4.0 ComplianceUsing RapidSpike to Support PCI DSS 4.0 Compliance
      • Level Up: With New Website Monitoring FeaturesLevel Up: With New Website Monitoring Features
      • Marketing Campaign Highlight- Sign Of The TimesMarketing Campaign Highlight: Sign Of The Times Since ’76
  • Pricing
  • Log In
  • Get Started
  • Use Cases
    • Type
      • EnterpriseHigh traffic websites with advanced functionality, such as booking, browsing or paying.
      • Small/MediumWebsites with low-mid traffic that have one or more key functionalities including checkout, sign-ups or account login.
      • AgenciesAgenciesWeb agencies that help clients build, maintain and improve their websites.
    • Industry
      • eCommerce
      • Travel
      • Gambling
      • Public Sector
    • Team
      • Technical
      • Digital
  • Platform
    • Platform
      • PerformanceRapidSpike’s performance tools help you improve website speed, so you can boost conversions and keep customers coming back.
      • SecurityProtection for your business and your customers from web skimming and form jacking attacks, and more
      • ReliabilityCustomer complaints can drive away future business. It’s vital you find, fix and prevent any issues fast.
    • Top Features
      • User Journeys
      • Magecart Attack Detection
      • Core Web Vitals Monitoring
      • Uptime
      • Alerting & Integrations
    • Take a guided tourLearn how RapidSpike can support your business today.
  • Customers
  • Learn
    • Learn
      • BlogNews updates and articles about web monitoring.
      • Knowledge BaseDocumentation and other resources for customers.
      • RapidSpike AcademyTraining courses and guided tutorials.
      • About UsWe help make the web faster, safer and easier to use.
      • PressSee what the press are saying about RapidSpike.
    • From The Blog
      • How RapidSpike Cookie Monitoring Can Support Managing GDPRHow RapidSpike Cookie Monitoring Can Support Managing GDPR
      • Using RapidSpike to Support PCI DSS 4.0 ComplianceUsing RapidSpike to Support PCI DSS 4.0 Compliance
      • Level Up: With New Website Monitoring FeaturesLevel Up: With New Website Monitoring Features
      • Marketing Campaign Highlight- Sign Of The TimesMarketing Campaign Highlight: Sign Of The Times Since ’76
  • Pricing
  • Log In
  • Get Started

Back to Knowledgebase

Categories

Account & Billing

Getting Started

Performance Monitoring

Alerts & Notifications

Uptime Monitoring

Security Monitoring

Synthetic User Journey Monitoring

Interpreting Data

Assurance and Search

Sitemap Monitoring

Other Articles

Action: GenerateItem – Password

Action: GenerateItem – Random String

Action: GenerateItem – Random Number

Action: GenerateItem – Email

Action: GenerateItem – Date

The ‘GenerateItem’ action is designed to create dynamic ‘items’ to use elsewhere in a script. Unlike the PickItem action which selects from a predefined list, this action is used for creating things dynamically such as randomised email addresses, passwords or dates.

This type generates whole or part dates and times according to a defined Format. They can be dynamically transformed as per your requirements using plain text phrases in the Transform option.

This can be especially useful for dynamically generating whole or part dates and times for a set period into the future to be used in search fields or URL parameters.

The action type has two options: Format and Transform.

Format

The format dictates how the date will be generated and can be used for producing whole or part dates and times. Format options can be found here. If you wish to enter a character and not have it interpreted into its corresponding format option, then it must be escaped with a backward slash (\).

  • Y-m-d – this would produce a date such as “2022-08-27”
  • H:i:s – this would produce a time such as “10:55:25”
  • Y-m-d H:i:s \(\B\S\T\) – this would produce a full timestamp including a set timezone in brackets “2022-10-05 09:59:15 (BST)” (note the backward slashes to escape the brackets and timezone characters)
  • Y – this will simply produce the year such as “2022”

If you require multiple date parts to use separately then you will need to use multiple GenerateItem: Date actions, one per date part.

Transform

This option can be used to dynamically change the date and time returned using a plain text expression. If no Transform option is given then the date and time will default to the server’s current timestamp in UTC.

Some examples of plain text transform expressions:

  • “+7 days” – this will produce a date that is +7 days ahead of the server’s current date when the test runs
  • “next Monday” – this will produce the date of the next Monday
  • “last year” – this will produce the current date, minus one year
  • “+1 week 2 days 4 hours 2 seconds” – this will produce the date to the provided Format but exactly 1 week, 2 days, 4 hours and 2 seconds in the future

Note: the date produced will always be relative to the server’s current date and time in UTC when it runs a test of your script.

This example generates a “Y-m-d” formatted date 7 days in the future:

To use the generated item, enter $ScriptVariable.<Name> where <Name> is the name you gave when setting up the action.

The generated string can be input into a text field using either a SendKeys, Form or FormSelector action, dynamically placed in the URL used in an Open action, or in the body of an ApiCall action. Here is an example of it being used in a SendKeys action:

Advanced Usage

Another use for this function would be to add dates to URL parameters. This requires a little more configuration but can be achieved by combining the GenerateItem: Date action with an Open action.

Using the same example as above, we will now insert the generated date variable into a “DynamicLinkPart”. This requires putting a placeholder in the Link option, which will then be swapped for the variable:

Here, the generated date will be entered into a URL query parameter. The myfuturedate placeholder in the Link field will be replaced with the content of $ScriptVariable.myfuturedate.

For example, if the generated date 7 days ahead is “2022-10-17” then the URL opened will be “https://www.rapidspike.com/?date=2022-10-17”.

This is useful if you’re testing search functionality that supports query parameters and requires the search to always be in the future relative to the current date.

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Cookie settingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT

Start your free 30-day trial today

Start monitoring today, no credit card required. Or chat to our friendly team about your requirements.

Get StartedLet’s Talk

RapidSpike - Global eCommerce Winner 2021
RapidSpike - Northern Digital Awards Winners
RapidSpike - Insider Yorkshires Most Exciting Companies
RapidSpike - UK Dev Awards 2021 Winner
RapidSpike - Prolific North Top Tech 30 To Watch
RapidSpike - Cyber Accelerator Alumni

Copyright © 2023 — All Rights Reserved.

RapidSpike - AWS Well Architected
RapidSpike - AWS Partner Network
  • Solutions
    • Technical
    • Digital
    • eCommerce
    • Travel
    • Gambling
    • Public Sector
    • Enterprise
    • Small/Medium
    • Agencies
    • New Relic
    • Customers
    • Pricing
  • Platform
    • Performance
    • Security
    • Reliability
    • How It Works
    • Insights
    • Alerting & Integrations
    • All Features
    • Synthetic User Journeys
    • Google Lighthouse
    • Core Web Vitals & Performance
    • Page Load
    • Real User Monitoring
    • Magecart Attack Detection
    • Uptime
    • Assurance & SEO
  • Learn
    • Blog
    • Knowledge Base
    • RapidSpike Academy
    • System Status
    • RapidSpike Roadmap
    • Log In
  • Company
    • About Us
    • Contact
    • Careers
    • Press
    • Privacy Policy
    • Terms & Conditions
    • Vulnerability Disclosure