Salesforce
PDI · Question #43
A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the De
Sign in or unlock PDI to reveal the answer and full explanation for question #43. The question stem and answer options stay visible for context.
Submitted by minji_kr· Apr 18, 2026Testing, Debugging, and Deployment
Question
A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console?
Options
- AThe test method has a syntax error in the code.
- BThe test method relies on existing data in the sandbox.
- CThe test method is calling an @future method.
- DThe test method does not use System.runAs to execute as a specific user.
Unlock PDI to see the answer
You've previewed enough free PDI questions. Unlock PDI for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#Apex Testing#Test Data Isolation#Execute Anonymous#Debugging