Currently, there is no dedicated feature to identify unstable locators within test cases.
We have received improvement requests for this point, and have created the following ticket:
Show unstable locators during editing
Here are some workarounds for identifying unstable locators.
Table of contents
Utilize MagicPod Autopilot
On the test case edit screen, you can ask MagicPod Autopilot to list unstable locators.
Prompt example:
Please review the locators in each step, check for any unstable locators, and list up suggested fixes.
Example response from MagicPod Autopilot:
If you want to apply the suggested locator fixes, you can give further instructions.
Prompt example:
Please update step ◯ and step ◯ with the suggested changes.
Utilize MagicPod Web API with generative AI
This guide explains how to identify unstable locators using the MagicPod Web API with generative AI tools such as ChatGPT, Gemini, and Claude.
For detailed information about the MagicPod Web API, please refer to the following page:
By setting the includes_locators_in_human_readable_steps parameter to true in the MagicPod Web API endpoint /v1.0/{organization_name}/{project_name}/test-cases/{test_case_number}/, you can retrieve locator information for each step.
Response example
Copy the "human_readable_steps" section from the response and pass it to a generative AI tool with a prompt as below:
Prompt example:
If there are any unstable locators used in the test case below, please identify the locator names and explain why they are unstable. If there are multiple unstable locators, please identify all of them. For the definition of unstable locators, please refer to the reference site. Test case: <Paste the "human_readable_steps" copied above> Reference site for unstable locators: https://support.magic-pod.com/hc/ja/articles/36551080267289-%E3%83%98%E3%83%AB%E3%82%B9%E3%82%B9%E3%82%B3%E3%82%A2%E6%A9%9F%E8%83%BD#h_01K46YMW31RE5CWEXA2684QM87
Example response from generative AI:
Utilize test_case.json with generative AI
By downloading a file containing locator information for each step of a test case and passing it to a generative AI tool, you can obtain responses that include UI information corresponding to the locators.
First, on the test results screen for the test case you want to check, click "Inquiry about the test result."
At the bottom of the inquiry template, there is a file named "test_case.json".
Click the "︙" > Download.
Please be careful not to accidentally submit the inquiry at this time.
Input a prompt like the following to the AI agent and attach the downloaded "test_case.json" file.
Prompt example:
The attached file contains test case information from MagicPod. Based on this, please tell me the ui_name that contains unstable locators and the reasons why they are unstable.
If there are multiple unstable locators, please tell me about all of them.
Locators are indicated by locator_key and locator_value.
Example response from generative AI:
Utilize the MagicPod MCP Server
AI integrated with the MagicPod MCP Server may provide more accurate responses.
For information on how to configure the MagicPod MCP Server, please refer to the following.
Additionally, when MagicPod's generative AI feature is enabled, the MCP server can retrieve information via the MagicPod Web API, so you can obtain similar results using prompts like the following.
In this case, you don't need to attach the Web API response information or "test_case.json".
Prompt example:
In MagicPod, if there are any unstable locators used in test number XX of the "XX" project in the "XX" organization, please identify the locator names and explain why they are unstable.
If there are multiple unstable locators, please identify all of them.
For information on enabling the generative AI feature, please refer to the following.