function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sharmila SahooSharmila Sahoo 

I am getting exception while trying to run test for Security Specialist Superbadge challege

User-added image
I have created User Samantha and created roles and profile as specified. I have also created opp as mentioned and created sharing rules. But still I am getting exception.
Please help to solve this issue.
Deepali KulshresthaDeepali Kulshrestha
Hi Sharmila,

I found from another fellow Trailblazer:
Rule1.
1. Label can be anything you like
2. Rule type = "based on criteria"
3.  Field = Type, Operator = Equals, Value = Existing Customer - Upgrade (the last one will be in the lookup using the icon right next to it)
- the second field will be: Field = Stage, Operator = Equals, Value = Closed Won (also use the lookup icon)

***Make sure you created a public group called "Project Managers" prior to this step if you haven't already***
4. "Share with" should be "Public Groups" in the first drop-down, and "Project Managers" for the second drop down.
5. Opportunity access should be set to "read-only"
Rule 2.
1. Label can be anything you like
2. Rule type = "Based on Record Owner"
3. Opportunity: owned by members of = Roles and Subordinates, and choose Sales Executives for the second drop-down menu
If you are unable to see Sales Executive in the 2nd drop down menu…….refer to this link & add the roles as suggested by Tim Calje:
https://developer.salesforce.com/forums/#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F0000000kEGAIA2
4. Share with: Roles, and choose Inside Sales Users for the second drop-down menu
5. Opportunity access should be set to "Read/Write"
Save both of these rules.

This allowed me to move forward to the Apex test.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha