• Use Cases
    • Technical
    • Digital
    • eCommerce
    • Travel
    • Gambling
    • Public Sector
    • Enterprise
    • Small/Medium
    • Agencies
    • RapidSpike VS New Relic
  • Platform
    • PerformanceImprove page speed and conversions.
    • SecurityStop hackers and find vulnerabilities.
    • ReliabilityTrack errors and issues, get alerts.
    • How It WorksA quick overview of the platform.
  • Customers
  • Learn
    • About UsWe help make the web faster, safer and easier to use.
    • Knowledge BaseWe aim to answer your most frequently asked questions.
    • From The BlogGet to know feature development, monitoring tips and even the RapidSpike team.
      • Why should you use Single Sign-On?
      • The Online Travel Landscape
      • The ultimate guide to website monitoring solutions
  • Pricing
  • Log In
  • Get Started
  • Use Cases
    • Technical
    • Digital
    • eCommerce
    • Travel
    • Gambling
    • Public Sector
    • Enterprise
    • Small/Medium
    • Agencies
    • RapidSpike VS New Relic
  • Platform
    • PerformanceImprove page speed and conversions.
    • SecurityStop hackers and find vulnerabilities.
    • ReliabilityTrack errors and issues, get alerts.
    • How It WorksA quick overview of the platform.
  • Customers
  • Learn
    • About UsWe help make the web faster, safer and easier to use.
    • Knowledge BaseWe aim to answer your most frequently asked questions.
    • From The BlogGet to know feature development, monitoring tips and even the RapidSpike team.
      • Why should you use Single Sign-On?
      • The Online Travel Landscape
      • The ultimate guide to website monitoring solutions
  • 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

Other Articles

Action: ApiCall

Action: CheckCookie

Action: Alert

Action: Dropdown

Action: ClickCoordinates

Action: PageSource

Action: IfElement

The ‘IfElement’ action allows you to handle multiple scenarios on your user journey. It is very similar to the ‘IfAssert’ but alot more equipped to deal with several scenarios rather than just two. This is particularly useful if you have active A/B testing on your site. You can easily add new scenarios as they are implemented.

To add an ‘IfElement’ first identify exactly where the elements change. It is also helpful to take note if there is a more likely scenario that the journey will reach. This will be the first element the script checks for.

Enter in the condition, selector and a comment which will set the first scenario to check. The Timeout is how long the journey will check before moving on to the next condition. We recommend keeping this to the standard 5 seconds. If you have 5 scenarios each with a 5 second timeout it will take 20 seconds to reach the final scenario.

To add another condition click ‘Add ‘ELSE IF’ Condition’ and repeat the process.

IfElement Set-Up

Back in the script editor you will now see the boxes which will house the actions for each scenario. You will notice that there is an extra box called ‘Else (All “if” Statements Return False), this is the scenario if everything else returns false. We would recommend using this for the least likely scenario/condition to reduce journey times.

Here is an example of the ‘IfElement’ in action. You can see three scenarios each expecting a different button for selecting a product. The following ‘WaitForElement’ assumes that the following page is the same no matter the scenario however you could include more steps within the scenario sections or create another ‘IfElement’ to handle this.

User Journey Example Step

If you have any questions or are struggling to implement the ‘IfElement’ in your journey feel free to contact support and we can help!

Start your free 30-day trial today

No credit card required.

GET STARTED

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 © 2022 — 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
    • Webpage Test
    • Real User Monitoring
    • Vulnerability Scanning
    • Magecart Attack Detection
    • Uptime
    • Assurance & SEO
  • Learn
    • Blog
    • Knowledge Base
    • API Documentation
    • System Status
    • RapidSpike Roadmap
    • Log In
  • Company
    • About Us
    • Contact
    • Careers
    • Press
    • Privacy Policy
    • Terms & Conditions
    • Vulnerability Disclosure