find-by-text
Generate XPath expressions to locate mobile app elements by text content for Android or iOS automation testing with Appium.
Instructions
Generate XPath to find element by text
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>",
"platformName": "<platformName>"
},
"name": "find-by-text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to search for | |
| platformName | Yes | Platform to generate XPath for | |
| exactMatch | No | Whether to match the text exactly (default: true) | |
| elementType | No | Filter by element type (e.g., android.widget.Button) |