On screens where A/B testing is being conducted, different UI versions are displayed for each user. To run stable tests with MagicPod on such screens, countermeasures are necessary.
[Recommended] Configure the test environment to display the same UI
When the specification calls for displaying different UIs based on Cookie values, use the Set cookie command to ensure the same UI is displayed.
Alternatively, there is a method to detect that the app is being accessed from MagicPod and display the same UI.
Methods to identify access from MagicPod:
- IP Address
- For the IP addresses used when MagicPod cloud devices access external resources, please refer to Test in private environments.
- If you are using a fixed user IP, it will be displayed on the organization settings screen.
- (Mobile apps only) App launch arguments/App environment variables
Use locators that can handle any UI version
Assign a common, unique ID to UI elements across all UI versions. By using locators that include this unique ID, you can keep test cases simple without implementing complex conditional branching.
Reference: How to assign a unique ID
Utilize conditional branching commands
Use MagicPod's conditional commands to implement steps that respond to the displayed version.
Implementation example:
- Use the "If UI element exists" command to check if a Version A UI element exists
- If the element exists, execute operations for Version A
- If the element does not exist, execute operations for Version B