Why my course is created in test automation and salesforce

Feb 25, 2024 | by Ralph Van Der Horst

Why my course is created in Test Automation and Salesforce

Introduction

I have being turned down a lot of times. 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 test automation strategy and manage juniors even if I do not have experience end to end what end-users/business implementation managers have with salesforce.

So here is an example salesforce automated testing strategie for Salesforce which can easily be implemented and 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 benefits 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 communication plans 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 implementations/ 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
   });
});

Conclusion:

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 process 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 process understanding above testautomation experience alone :-), which is a nice to have but not at first!

Follow me on LinkedIn: Click Here

by Ralph Van Der Horst

by Ralph Van Der Horst

arrow right
back to blog

share this article

Relevant articles

Setup oauth2 client for Salesforce dev env for API testing using curl postman and Katalon

Mar 24, 2024

Setup oauth2 client for Salesforce dev env for API testing using curl postman and Katalon