Test automation and Salesforce

It’s a familiar story: being turned down for a position in SAP or Salesforce as a freelance tester because of a perceived lack of knowledge. But truly effective tech work isn’t just about mastering a tool. It’s about the broader understanding, the ability to ask “why”, and seeing the entire landscape. Throughout my career, I’ve not only worked with platforms like Salesforce but have played a pivotal role in orchestrating testing processes and steering test automation. Sure, specific platform expertise has its place, but leadership, analytical thinking, and holistic problem solving are where genuine value lies. In this blog, I’ll delve into why broad experience often outweighs specific tool expertise.

Today I want to prove I can easily create a testautomation strategy and manage juniors even if I do not have experience end to end what endusers/business implementation managers have with salesforce

So here is an example salesforce automated testing strategie for Salesforce which can easily be implemented copied to SAP

Test Automation Strategy

1. Define Objectives:

  • Determine automation goals: faster deployment cycles, reliable testing, etc.

2. Identify Test Scenarios:

  • Unit Tests: Small parts of application logic using Apex tests. It is like java and have experiented with it myself, but work together with dev to setup a risk based setup to get much as coverage as possible
  • Integration Tests: Integration points between Salesforce and other systems, which often is the most critical problem at various companies (see service virt and pact blog to see the benifits of this)
  • Regression Tests: Ensure existing functions aren’t broken by changes, a no brainer
  • UI Tests: Test custom Visualforce pages or Lightning components.

3. Choose the Right Tools:

  • Built-in: Apex Test Execution, can not judge this did not use it
  • External: Selenium, Provar, AssureClick, Copado. I know Selenium and provar, but would now always choose selenium and then in javascript like playwright or webdriverio for the support of devtools, although shadowdom is tricky to manage
  • CI/CD: Jenkins, Bamboo, gitlab and githubactions-, my personal pref: gitlab, but I do everything with this

4. Develop the Test Cases:

  • Cover both positive and negative scenarios.
  • Do much as possible testing via unit testing if it has value
  • Use api business logic testing over ui, if possible
  • Ensure Apex code coverage for deployment, risk based

5. Prioritize Test Cases:

  • Decide test frequency and criticality, set up communciationplans align the value to POS

6. CI/CD:

  • Automate deployment and testing on code check-ins.

7. Test Data Management:

  • Maintain and load test data using Data Loader inject into tables, although I have strong pref for testdata as code

8. Scheduled Runs & Monitoring:

  • Schedule regular regression tests and monitor outcomes.

9. Maintain & Review:

  • Update tests post Salesforce’s tri-annual updates.

10. Documentation & Training:

  • Document and train the team.

11. Feedback Loop:

  • Regularly refine the automation process via feedback.

Here is a code example, Bsure-Digital can help setup automation testing at scale for salesforce implemenatations/updates for projects on request a in selenium grid with 100 sessions,hosting in a kubernetes cluster in my business account, own account(kubernetes, aws ecs etc), or probably in cypress, playwright, java

Attached a code snippet of a gitlab project of mine:just for inspiration.

describe('Salesforce Test Automation', () => {

    // Constants
    const SALESFORCE_URL = `https://empathetic-wolf-6gqwxj-dev-ed.trailblaze.lightning.force.com/`;
    const USER_EMAIL = process.env.SF_USER_EMAIL;
    const USER_PASSWORD = process.env.SF_USER_PASSWORD;

    // Utility: Wait for element
    async function waitForElement(selector) {
        await browser.waitUntil(
            async () => (await $(selector).isDisplayed()),
                timeout: 5000,
                timeoutMsg: `Expected ${selector} to be visible`

    it('should login with valid credentials', async () => {
        await browser.url(SALESFORCE_URL);
        await waitForElement('#username');
        await $('#username').setValue(USER_EMAIL);
        await waitForElement('#password');
        await $('#password').setValue(USER_PASSWORD);
        await waitForElement('[type=submit]');
        await $('[type=submit]').click();

    it('create an account', async () => {
        await waitForElement('>>>[title="Accounts"]');
        const accountTab = await $('>>>[title="Accounts"]');
        await accountTab.click();

        await waitForElement('[title="New"]');
        await $('[title="New"]').click();
        await waitForElement('>>>[name="Name"]');
        await $('>>>[name="Name"]').setValue("TEST");

        // Set dropdown values with helper function if necessary

        await waitForElement('//button[contains(@name,"SaveEdit")]');
        await $('//button[contains(@name,"SaveEdit")]').click();

    it('Deletes an account', async () => {
        await waitForElement('>>>[title="Accounts"]');
        const accountTab = await $('>>>[title="Accounts"]');
        await accountTab.click();

        // Handle account deletion



I like salesforce, I am trying to use it as a user for my own company and also while try to learn it I undertand it is very customizeable product and you never can learn enough it is still a product with an entry,a business proces and an output, in which decisions can be made by testers what to test and why this is needed, and how to manage the junior/medior testers enabling them to help them meeting their goals.

My main message is, do not mix the seniority of a tester with the experience of Salesforce or Sap, and personally I would always choose the senior tester, even he does not have domain knowledge when:
-he/she can easily understand why he/she is testing something,
-he/she is being able to understand the proces quickly
-he/she can adapt and manage to set up a product risks strategy for testautomation, guiding stakeholders and testers.

This is how I drill juniors/mediors for my own company to get them to be the best in the field. I always opt for seniority and logical proces understanding above application experience :-), which is a nice to have!

Follow me on LinkedIn: www.linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&followMember=ralphvanderhorst

Related articles

Integrating python Gmail api using Service Account to fetch e.g. oauth


15 Oct 2023

Integrating python Gmail api using Service Account to fetch e.g. oauth

Mastering Waits in UI Automation


6 Oct 2023

Mastering Waits in UI Automation

Parrallel testing with Python, Cucumber, and Docker Compose


6 Oct 2023

Parrallel testing with Python, Cucumber, and Docker Compose


Are you ready to learn everything regarding testautomation

The guided path and the learnportal will make you a t-shaped tester. Guided by advanced material and hosted by a senior tester this portal will help you become professional

Contact us