UI handle alert
This test step responds to a UI alert dialog which appears after a UI operation has been performed and needs handling to proceed further. This is useful for handling standard alert, confirmation or error messages appearing on certain Salesforce operations such as deleting records.
This test step can be added when mapping an alert through the Test Builder.
It can also be added via the Test Palette by locating the test step and dragging it into the test case.
Update the following parameters:
- Expected Message: Exact text of the UI alert to be handled (case sensitive)
- Response: The response to the Alert, e.g. OK, Cancel
Refer to Managing test steps for more information on updating Wait and Screenshot Options.
Then save the test case.
Note: Multiple alerts can be configured on the same test step. This is useful if different alerts have been configured on a single operation based on the business flow. In such cases, Provar simply matches the text on the alert which appears and performs the configured operation.
Example
This example illustrates the usage of the UI Handle Alert test step to cancel or confirm the deletion of an Account record in Salesforce.
Step 1: Create a test case and launch the Test Builder. From the ‘All Accounts’ list view, locate the ‘Delete’ link on the first row of Account data in the list view. Right click on this link and select ‘Add to Test Case’, then select ‘Add & Do’ on the draft Test Step.
Step 2: When the Salesforce alert appears asking for confirmation, click on Handle a Browser Alert on the Test Builder:
Step 3: Enter the text in the Expected Message field on the Test Builder as it appears on the alert and choose the option to ‘Cancel’. Then click the Add & Do button.
Note that the Account has not been deleted:
Step 4: Repeat the above steps to re-attempt deletion and bring up the same UI alert. This time choose the option to click ‘OK’ and then select Add & Do.
Note that this time the account has been deleted.
- General information
- Licensing Provar
- Provar trial guide and extensions
- Using Provar
- API testing
- Behavior-driven development
- Creating and importing projects
- Creating test cases
- Custom table mapping
- Functions
- Debugging tests
- Defining a namespace prefix on a connection
- Defining proxy settings
- Environment management
- Exporting test cases into a PDF
- Exporting test projects
- Managing test steps
- Namespace org testing
- Provar desktop
- Provar Test Builder
- Refresh and Recompile
- Reload Org Cache
- Reporting
- Running tests
- Searching Provar with find usages
- Secrets management and encryption
- Setup and teardown test cases
- Tags and Service Level Agreements (SLAs)
- Test cycles
- Test plans
- Testing browser options
- Tooltip testing
- Using the Test Palette
- Using custom APIs
- Callable tests
- Data-driven testing
- Page objects
- Block locator strategies
- Introduction to XPaths
- Creating an XPath
- JavaScript locator support
- Label locator strategies
- Maintaining page objects
- Mapping non-Salesforce fields
- Page object operations
- ProvarX™
- Refresh and reselect field locators in Test Builder
- Using Java method annotations for custom objects
- Applications testing
- DevOps
- Introduction to test scheduling
- Apache Ant
- Configuration for sending emails via the Provar Command Line Interface (CLI)
- Continuous integration
- AutoRABIT
- Azure DevOps
- Running a Provar CI task in Azure DevOps
- Configuring the Provar secrets password in Microsoft Azure Pipelines
- Parallel execution in Microsoft Azure Pipelines using multiple build.xml files
- Parallel execution in Microsoft Azure Pipelines using targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- Circle CI
- Copado
- Docker
- Flosum
- Gearset
- GitHub Actions
- Running a Provar CI task in GitHub Actions
- Remote Trigger in GitHub Actions
- Parameterization using Environment Variables in GitHub Actions
- Parallel Execution in GitHub Actions using multiple build.xml files
- Parallel Execution in GitHub Actions using Targets
- Parallel Execution in GitHub Actions using Test Plan
- Parallel Execution in GitHub Actions using Job Matrix
- GitLab CI
- Jenkins
- Travis CI
- Parallel Execution
- Running Provar on Linux
- Reporting
- Salesforce DX
- Git
- Team foundation server
- Version control
- Zephyr Cloud and Server
- Salesforce testing
- Adding a Salesforce connection
- Assert Page Error Messages on Add/Edit Product
- Dynamic Forms
- Internationalization support
- List and table testing
- Salesforce Release Updates
- Salesforce Lightning Testing
- Salesforce Lightning Web Component (LWC) locator support
- Salesforce console testing
- Visualforce Testing
- Testing best practices
- Troubleshooting
- Release notes