testRigor & Salesforce
  • NO-CODE UI TESTING: Guide for testRigor & Salesforce
  • Getting Started
    • Get a Salesforce Hands-On Playground Org (free)
    • Get testRigor (free) and create a Test Suite
    • Create Test Case (T00001)
    • Navigation in Salesforce
    • Navigation in testRigor
  • BASIC TEST CASES
    • Record, edit and play a Test Case (T00002)
    • Create and convert a Lead (T00003)
    • Create more records (T00004)
    • Check Account Validation Rule (T00005)
  • ADVANCED TEST CASES
    • Account Action and List View Button (T00006)
    • Validate Field Value Using REST API (T00007)
    • E2E: Lead entry (Titan) ➔ Salesforce ➔ Email
  • OTHER TEST SCENARIOS
    • Submit a Test Lead
    • TH: Opportunity Won THEN Create Contract
    • Monitor data in your website
    • Monitoring in Production
  • FLOW TEST CASES
    • Screen Flow: Update Email Address
  • E-BIKES SAMPLE APP
    • E-Bikes sample app description
    • testRigor version of the UTAM TEST (EBIKES-00001)
    • Product Explorer - Electra X3 (EBIKES-00002)
    • Reseller Order - Create (EBIKES-00003)
    • Case - Create (EBIKES-00004)
  • LWC RECIPES SAMPLE APP
    • LWC Recipes sample app description
    • Test Case for LWC Recipes (LWC-00001)
  • CORAL CLOUDS SAMPLE APP
    • Coral Clouds sample app description
    • Experience - Generate Description using AI (CC-00001)
    • Experience - Generate Reviews Summary using AI (CC-00002)
  • MORE INFORMATION
    • About testing
    • About testing in Salesforce 🤔
    • About test automation
    • About Test-Driven Development (TDD)
    • About testRigor
    • About using testRigor
    • About other solutions
  • FEEDBACK
    • Questions? - Comments!
Powered by GitBook
On this page
  • Create Global Variables
  • Create a Reusable Rule
  • Create Test Case T00004
  • Observe results
  • Observe Test Case
  • Observe Records in Salesforce
  • Highlights from testRigor Test Case Run Screenshots
  1. BASIC TEST CASES

Create more records (T00004)

PreviousCreate and convert a Lead (T00003)NextCheck Account Validation Rule (T00005)

Last updated 5 months ago

  • Global variables store details so we don't need to type and maintain them in several places

    • For this purpose we'll create two Global Variables

  • Saving records with unique time stamps and identifiers helps monitoring and troubleshooting.

    • For this purpose we'll create one Reusable Rules.


Create Global Variables

  • Click: "Test Data"

  • Click: "+ Add"

  • Enter Type: Text

  • Enter Name: "URL_SALESFORCE_HOME"

  • Enter Value: [url of your Salesforce Hands-on Playground Org]

  • Click: "Add"

  • Click: "+ Add"

  • Enter Type: Text

  • Enter Name: "DATETIME_START_LOCAL"

  • Enter Value: "YYYY-MM-DD - HH:MM:SS"

  • Click: "Add"


Create a Reusable Rule

  • We'll use javascript to set a datetimestamp: DATETIME_START_LOCAL

  • Click: "Reusable Rules"

  • Click: "New Rule"

  • Enter Name: "UTIL-0001 - Set DATETIME_START_LOCAL"

  • Enter Label: "UTIL"

  • Copy-paste Steps from below

  • If needed, edit the GMT offset for your timezone.

  • Click: "Save"

execute JavaScript text starting from next line and ending with [END]
 
  nd = new Date();
  nd.setHours(nd.getHours() + 2); // Helsinki (Finland) = GMT + 2
  var s = new String( nd.toISOString() );
  
  var DATETIME_START_LOCAL = s.substr(0,10) + " - " + s.substr(11,8);
  var trCommand = 'save value "' + DATETIME_START_LOCAL + '" into "DATETIME_START_LOCAL"';
  testRigor.execute( trCommand );
  
[END]

Create Test Case T00004

  • Click: "Test Cases"

  • Click: "+ Add Test Case"

  • Enter Description: "T00004 - Create Account, Contact, Opportunity"

  • Copy-paste steps from below

  • Click: "Add and Run"

UTIL-0001 - Set DATETIME_START_LOCAL
login

// CREATE ACCOUNT //
open URL from string with parameters "${URL_SALESFORCE_HOME}/lightning/o/Account/new"
generate from template by string with parameters "!TEST ACCOUNT - ${DATETIME_START_LOCAL} - %%%-%%", then enter into "Account Name" and save as "AccountGenerated"
enter "TEST-ACCOUNT-NUMBER" into "Account Number"
select "Utilities" from "Industry"
click on "Save"
grab url and save it as "URL_Account"
check that page contains stored value "AccountGenerated"

// CREATE CONTACT FOR ACCOUNT //
open URL from string with parameters "${URL_Account}"
click "Contacts ("
click "New" 
generate from template by string with parameters "First - %%%-%%",                          then enter into "First Name" and save as "ContactFirstNameGenerated"
generate from template by string with parameters "Last - ${DATETIME_START_LOCAL} - %%%-%%",   then enter into "Last Name"  and save as "ContactLastNameGenerated"
enter "!TEST CONTACT" into "TITLE"
click "Save"
click from string with parameters "${ContactFirstNameGenerated}"
grab url and save it as "URL_Contact"
check that page contains stored value "ContactFirstNameGenerated"
check that page contains stored value "ContactLastNameGenerated"


// CREATE OPPORTUNITY FOR ACCOUNT AND CONTACT//
open URL from string with parameters "${URL_Account}"
click "Opportunities ("
click "New" 

generate from template by string with parameters "!TEST OPPORTUNITY - ${DATETIME_START_LOCAL} - %%%-%%", then enter into "Opportunity Name" and save as "OpportunityGenerated"
select "Qualification" from "Stage"
enter "9.9.2025" into "CloseDate" 
enter "1.23" into "Amount"

// Populating a Lookup to Contact can be filled, too
// - in fresh Salesforce Hands-On Playground Orgs there is no Contact Lookup in Opportunity
// - feel free to create the field ("Primary Contact") and add it to Opportunity Layout
// - then uncomment next two lines
// enter from string with parameters "${ContactLastNameGenerated}" into "Primary Contact"
// click from string with parameters "${ContactFirstNameGenerated}"

click on "Save"

click from string with parameters "${OpportunityGenerated}"
grab url and save it as "URL_Opportunity"
check that page contains stored value "OpportunityGenerated"

Observe results

Observe Test Case

  • Scroll down to see the Run(s)

  • Observe the progress

Observe Records in Salesforce

  • Login to Salesforce

  • Check records

    • Account

    • Contact

    • Opportunity


Highlights from testRigor Test Case Run Screenshots


NO-CODE UI TESTING: Guide for testRigor & Salesforce
Checks that the Account with unique name was created
Checks that the Contact with the unique name was created
Checks that the Opportunity with the unique name was created