Skip to content

appium_get_source fails to return page source despite active session #22

@Dor-bl

Description

@Dor-bl

Description

The appium_get_source tool fails to retrieve the page source from an active Appium session, even though the session is confirmed to be running and appium_list_sessions returns valid session information.

Environment

  • Platform: Android
  • MCP Tool: appium_get_source
  • Session Type: Android mobile automation
  • App: CropX mobile application

Steps to Reproduce

  1. Start an Appium session with an Android device
  2. Verify active session using appium_list_sessions - returns valid session ID
  3. Call appium_get_source with empty parameters {}
  4. Tool fails to return page source or returns incomplete/no data

Expected Behavior

The appium_get_source tool should return the complete XML page source of the current screen, similar to Appium's standard driver.getPageSource() command.

Expected output format:

<?xml version="1.0" encoding="UTF-8"?>
<hierarchy>
  <android.widget.FrameLayout ...>
    <!-- Full page source XML -->
  </android.widget.FrameLayout>
</hierarchy>

Actual Behavior

  • The tool either returns no data, incomplete data, or throws an error
  • Session appears to become "inactive" or unresponsive after the call
  • Subsequent calls to appium_get_source continue to fail
  • Other Appium MCP tools (like appium_find_element, appium_click_element) work correctly

Observations

  • appium_list_sessions confirms an active session exists
  • appium_find_element successfully locates elements
  • appium_click_element successfully interacts with elements
  • Only appium_get_source appears to fail consistently

Example Session Flow

1. appium_list_sessions → ✅ Returns active session
2. appium_find_element (id: "welcome_login_button") → ✅ Success
3. appium_click_element → ✅ Success
4. appium_get_source → ❌ Fails/returns no data
5. appium_get_source (retry) → ❌ "Session seems inactive"

Impact

This issue prevents:

  • Automated verification of element IDs on the current screen
  • Debugging and inspection of the UI hierarchy
  • Validation of expected elements after navigation
  • Creating comprehensive locator verification reports

Workaround

Currently, no reliable workaround exists within the MCP toolset. Manual inspection using Appium Desktop or direct Appium client calls is required.

Additional Context

This issue was encountered while trying to verify element locators on mobile screens during automated testing workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions