> For the complete documentation index, see [llms.txt](https://learning.contextqa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learning.contextqa.com/packaged-application-testing/salesforce-testing/permissions-validation-flows.md).

# Permissions, Validation Rules, and Flows

Validate Salesforce role access, required fields, Flow branches, approval boundaries, and rejected transitions before a release.

> **Documentation owner:** [Deep Barot](https://contextqa.com/academy/) · **Last updated:** November 12, 2026

## Quick answer

Build a matrix of roles, records, actions, and expected outcomes. Test allowed and denied actions through the UI and relevant APIs, then verify stored state. For validation rules and Flows, cover each important branch and threshold with controlled data, including failures, asynchronous outcomes, and downstream effects.

## Key takeaways

* Record active rule and Flow versions alongside the tested build.
* A hidden UI control does not establish API authorization.
* Negative tests require the intended rejection and unchanged protected state.

## Define the acceptance matrix

Start with one process, such as claim closure or opportunity approval. Ask the owner to specify the rule rather than inferring it from current behavior.

| Role and state                             | Action                                     | Expected result                                       |
| ------------------------------------------ | ------------------------------------------ | ----------------------------------------------------- |
| Assigned handler; evidence complete        | Close the test claim                       | Closure succeeds and evidence remains linked          |
| Assigned handler; required evidence absent | Close the test claim                       | Specific validation error; status remains open        |
| Restricted user                            | Read or modify another owner’s test record | Access denied according to the approved sharing model |
| Approver; threshold reached                | Approve the request                        | Decision attributed to the approver and recorded once |

These are illustrative expectations. Replace them with your org’s policy before generating cases.

## How to implement the tests

1. Inventory relevant permission sets, profiles, sharing, field access, record types, active rules, and Flow versions. Record the sandbox and configuration revision.
2. Prepare synthetic records for each state. Assign each role a distinct login prerequisite and avoid session reuse across identities.
3. Create an allowed-path case with explicit assertions for the visible action, saved fields, owner, and dependent records.
4. Create a denied-path case under the restricted identity. Try only the authorized test record and action; assert the intended denial through the UI and relevant API.
5. For a numeric or date condition, test below, at, and above the boundary. Record timezone, currency, and rounding assumptions.
6. Exercise each material Flow decision branch, fault route, and approval outcome. For scheduled or asynchronous work, use approved test conditions and a bounded wait for the documented terminal state.
7. Verify final state and side effects. Repeated events should follow the integration’s documented idempotency behavior.
8. Review failure evidence and map cases to the changed components. Rerun affected and critical shared journeys against the candidate.

## Handling inactive controls

Some demonstration environments intentionally leave validation rules inactive. A save that succeeds without required evidence exposes the current configuration; it does not prove the intended control passed. Record the gap, obtain the owner’s intended policy, and activate only approved controls through the normal change process. Keep the original failing case so the repaired behavior can be verified.

## Flow failure diagnosis

Separate a product or configuration defect from invalid test data, missing permissions, unavailable integrations, and incomplete asynchronous work. Capture the expected branch, actual branch or resulting record state, input data category, role, and relevant logs. Redact record contents before attaching evidence to an issue.

Use [Slack and Linear reproduction workflows](https://learning.contextqa.com/enterprise-application-testing/ship/slack-linear-to-release.md) to collect evidence and hand it to an engineer. After a proposed fix, compare the configured Flow/rule version and rerun the exact failed scenario plus affected regression.

## Frequently asked questions

### Does a hidden button prove a user cannot perform the action?

No. Validate the corresponding authorized API or supported action path under the same restricted identity. UI visibility and server-side authorization are separate assertions.

### Can locator recovery repair a failed business rule?

No. [Self-healing](https://learning.contextqa.com/enterprise-application-testing/web-testing/self-healing.md) can help with changed element location. It must not change the expected business outcome or turn an invalid transition into a passing test.

### Can generated tests discover our approval policy automatically?

Context can help generation, but the approved policy is the acceptance criterion. Supply thresholds, roles, branches, and exceptions explicitly, then review the proposed coverage.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learning.contextqa.com/packaged-application-testing/salesforce-testing/permissions-validation-flows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
