Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Salesforce Certified Platform Developer (Plat-Dev-201) Topic 2 Question 93 Discussion

Actual exam question for Salesforce's Salesforce Certified Platform Developer (Plat-Dev-201) exam
Question #: 93
Topic #: 2
[All Salesforce Certified Platform Developer (Plat-Dev-201) Questions]

While working in a sandbox, an Apex test fails when run in the Test Runner. However, executing the Apex logic in the Execute Anonymous window succeeds with no exceptions or errors.

Why did the method fail in the sandbox test framework but succeed in the Developer Console?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Goldie
4 days ago
Okay, let's think this through step-by-step. The fact that it works in the Execute Anonymous window but not the test runner suggests an issue with the test environment or data setup.
upvoted 0 times
...
Penney
18 days ago
I'm a bit confused. Doesn't option C specify both VLANs at once? Isn't that what we need for VLAN 10 and 20, or am I misremembering?
upvoted 0 times
...
Annabelle
19 days ago
This question seems straightforward, but I want to make sure I understand the key steps before answering.
upvoted 0 times
...
Lynelle
5 months ago
You know, I once had a test that passed in the console but failed in the runner because I forgot to mock a callout. Maybe it's something like that?
upvoted 0 times
Trevor
3 months ago
C) The test method relies on existing data in the sandbox.
upvoted 0 times
...
Isaiah
3 months ago
B) The test method is calling an @future method.
upvoted 0 times
...
Lonny
4 months ago
A) The test method does not use system. runAs to execute as a specific user.
upvoted 0 times
...
...
Raymon
5 months ago
Haha, I bet the developer forgot to include a semicolon somewhere. Classic mistake! Gotta be option D.
upvoted 0 times
Carey
4 months ago
C) The test method relies on existing data in the sandbox.
upvoted 0 times
...
Chi
4 months ago
B) The test method is calling an @future method.
upvoted 0 times
...
Josefa
4 months ago
A) The test method does not use system. runAs to execute as a specific user.
upvoted 0 times
...
...
An
5 months ago
I'm going with C. The test method must be relying on existing data in the sandbox, which might not be present in the test environment.
upvoted 0 times
Mari
4 months ago
C) The test method relies on existing data in the sandbox.
upvoted 0 times
...
Jospeh
4 months ago
B) The test method is calling an @future method.
upvoted 0 times
...
Isidra
5 months ago
A) The test method does not use system. runAs to execute as a specific user.
upvoted 0 times
...
...
Linn
6 months ago
I believe the test method failed because it is calling an @future method, which is not supported in the sandbox test framework.
upvoted 0 times
...
Clay
6 months ago
I agree with Shawna. The test method might be expecting certain data that is not available in the sandbox.
upvoted 0 times
...
Kaitlyn
6 months ago
Hmm, I think it's option B. The @future method could be causing the issue in the test runner, but working fine in the Execute Anonymous window.
upvoted 0 times
Sylvie
5 months ago
D) The test method has a syntax error in the code.
upvoted 0 times
...
Thaddeus
5 months ago
C) The test method relies on existing data in the sandbox.
upvoted 0 times
...
Huey
5 months ago
B) The test method is calling an @future method.
upvoted 0 times
...
Lemuel
5 months ago
A) The test method does not use system. runAs to execute as a specific user.
upvoted 0 times
...
...
Shawna
6 months ago
I think the method failed in the sandbox test framework because it relies on existing data in the sandbox.
upvoted 0 times
...

Save Cancel