Scripted tests make it possible to capture content that is only accessible after navigating through a common user flow on your site (like adding products to the cart), or to scan pages that require user interaction to load content (like a button click that initiates client-side XHR requests).
How should you create a Scripted test?
Scripted tests are best utilized when you have a team or resources dedicated to creating and maintaining your test suite and should be utilized when you need to analyze page content that can't be scanned without user interaction or by simulating a user flow.
Common steps to identify use cases for Scripted performance tests:
- Answer the question: does test case needs to be recurring or can be a one time analysis?
- Identify whether you can scan the same content with a Single Page or HAR File test
- Outline requirements of your automated test and the desired outcome before writing script.
- Map test cases to existing automation in synthetic monitors or other functional tests
Most organizations already have data that can reinforce the most important pages to test.
- Synthetic or RUM data that outline your conversion funnel or
- Existing automated and functional tests that navigate common user paths
Are you trying to scan a page behind a login form? Rigor Optimization provides out-of-the-box functionality to scan a single page behind a login. Learn more about testing pages with authentication from our Knowledge Base.
Common use cases for Scripted tests
Example: Restoration Hardware - Duvet Product Page
Test URL: https://www.restorationhardware.com/catalog/product/product.jsp?productId=prod8410426&categoryId=search&src=rel
Many sites are implementing single page app frameworks and micro services that are responsible for core site functionality. Many times, these pages utilize XHR/AJAX requests to load in content based on the user's interactions with the page.
In this example, when a user changes filter options present on RH's product details page, requests are made to an API that pull back the product data to match filter options you choose. We can use a scripted test in order to capture these requests that aren't triggered as a part of the core page load.
Online Publishers and Media
Example: BuzzFeed Homepage - Lazy Loaded Content
Test URL: https://www.buzzfeed.com/
Some media sites implement lazy loading to defer requesting content below the fold until a user scrolls down on the page. This introduces performance gains and provides a better user experience for mobile devices. When you run a Single Page test in Rigor Optimization, our scanner will automatically scroll 1000 pixels on the viewport that you're testing But what if you want to scan content that is lazy loaded past the 1000 pixels? Scripted tests are a great way to emulate this user behavior by enacting click and scroll actions on the page.
SaaS / Enterprise
Example: Rigor - Real Browser Performance History Graph
Test URL: https://monitoring.rigor.com/checks/real-browsers/<check_id>
Most SaaS applications require logins to access in-app pages. Rigor's Monitoring solution tracks your site's performance over time and exposes this data for our users to gain visibility into performance and identify trends over time. When we access a Real Browser Check page, we use XHR requests to serve data that populate graphs and data tables. In order to test these graphs and tables, you must log in, then click through a few screens to access the page with the content we'd want to scan. A scripted test would serve as a viable option to test the data served through these requests and is a scalable and repeatable method to test these pages.