Skip to main content
The Trailblazer Community will undergo maintenance on Saturday, November 15, 2025 and Sunday, November 16, 2025. Please plan your activities accordingly.

Prepare Your Test Environment and Data

Learning Objectives

After completing this unit, you’ll be able to:

  • Learn how to use the Test Environment Setup page.
  • Create and manage test data for scale testing.
  • Explain the importance of realistic test data.

Next, you focus on setting up your test environment and data for scale testing. Test data is a critical component of testing, as it helps you simulate real-world scenarios and ensures that your tests are accurate and meaningful. Want to get reliable results from your load tests? It's all about accurate workload modeling. Here are some good tips to keep in mind.

  • Ditch static user counts. Instead, drive your load tests using requests per second (RPS) or transactions per second (TPS). This approach creates a more consistent, production-like simulation.
  • Act like a real user. Don't make your virtual users robots. Give them realistic behaviors by using random distributions for things like think times, pacing, and ramp-up rates.
  • Get precise with your data. Make sure you handle all the dynamic values like session IDs and tokens. This ensures each virtual user session is unique and realistic, just like in the real world.

Visual charts in Scale Test show planned and actual requests per second (RPS) metrics and user projections.

Why Realistic Test Data Is Important

  • Accuracy: Realistic test data ensures that your tests accurately reflect real-world usage, making the results more reliable.
  • Relevance: Using realistic data helps you identify performance issues that are relevant to your users, rather than artificial or edge cases.
  • Consistency: Consistent test data helps you compare results across different tests, making it easier to track improvements and identify trends.

The Test Environment Setup page is your home for this stage in your testing. You’ll use it for two main purposes.

  • Managing GitHub workloads, syncing them, and fetching workloads.
  • Estimating the scale of your upcoming tests by calculating the average RPS based on your trial run.

Steps to Create and Manage Test Data

Testing Step

Description

Identify Data Requirements

  • RPS Estimator: Compare the results of your sandbox trial runs with your production environment. Use this information to help you estimate RPS for future tests. Requests per second are the cumulative throughput of application-generated requests, including Lightning XHRs, Inbound API Calls to Salesforce, and Visualforce requests. You must provide your expected maximum RPS when booking your test. If you test beyond that, or if your test causes issues in the overall instance, Salesforce reserves the right to stop it.
  • User workflows: Identify the key user workflows that you want to test. For example, customer interactions, chatbot responses, and agent activities.
  • Data volume: Determine the volume of data needed to simulate real-world conditions. For example, if your application processes 10,000 leads per day, you should use a similar volume in your tests.

Generate Test Data

  • Data generation tools: Use data generation tools to create realistic test data if you don’t already have data set up in your full copy sandbox. Salesforce provides tools like Data Mask & Seed to help you generate and manage test data.
  • Real-world data: Consider using anonymized real-world data to ensure that your test data is as realistic as possible.

Manage Test Data

  • Data refresh: Regularly refresh your test data to ensure it remains up-to-date and relevant.
  • Data masking: Use data masking to protect sensitive information in your test data, ensuring compliance with data privacy regulations.

Validate Test Data

  • Data quality: Validate the quality of your test data to ensure it meets the requirements of your tests.
  • Data consistency: Ensure that your test data is consistent across different test runs to maintain the reliability of your results.

Use Case: Prequalify Applicants for a Financial Services Portal

You’re testing a financial services portal that uses Agentforce for prequalifying applicants via a chatbot.

  • To simulate real conditions, you generate 100,000 anonymized applicant records using Sandbox Seeding and Data Mask.
  • You then sync Playwright scripts from GitHub. Playwright scripts are used for automating web browser interactions, primarily for end-to-end testing. These scripts are executed within a Playwright environment, separate from the browser's page environment.
  • Finally, you calculate the projected load using the RPS Estimator.

These workflows include customer interactions, document uploads, and backend scoring logic. You’ve created and managed test data and now you’re ready for test trial runs!

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈