Skip to main content

#UI Validation Tests0 utenti parlano di questo argomento

Hi everyone,

 

I've having trouble in testing my Record-Triggered flow using the Tests feature, that I cannot overcome.

 

In summary, when I run with the Debug, everything is fine, and flow runs until the end.

However, when I run with a Test (either a Test converted from the Debug run, or a new Test created from scratch), it won't run the same way, i.e., it will fail, as it cannot find records related to the $Record that triggered the flow.

 

I've noticed that the Record ID is not the same between the Debug and the Test. In fact, the Record ID,

 from test does not exists. I don't understand why running a Test is making up an inexistent record ID.

 

Please find below is the interview starting info with the correct (existing) Record Id for the Debug run.Flow different behavior between debug and test

 

Below is the interview starting info with the incorrect (non existing) Record Id for the Test run.

(actually, each time I run the Test, it makes up a new Record ID)Record ID from Test.png

 

Has anyone already add this problem ? Is this a bug or is there something I'm missing? Is there a workaround?

 

Thanks in advance

 

#Flow  #Record-Triggered  #Record Id Value  #UI Validation Tests  #Test Case Management

1 risposta
  1. Davis Johnson (SolomonEdwards) Forum Ambassador
    26 feb 2024, 16:25

    @Tiago Simao,

    Flow tests take a copy of the triggering record as the record they operate on. And (similar to Apex tests), the record is never actually committed to the database, it exists solely as on-demand test data. Here is an article that sums up that functionality: https://help.salesforce.com/s/articleView?id=sf.flow_concepts_testing.htm&type=5

    What exactly is the problem you are running into, though?

0/9000

Has anyone found a way to disable pop up notifications in your Scratch Org? I'm investigating using Scratch Orgs for executing automated UI validation tests, and these sporadic pop-ups are skewing the executions.

9 commenti
0/9000