feat: Add multi-display support for Android automation#729
feat: Add multi-display support for Android automation#729ccxj wants to merge 1 commit intoappium:masterfrom
Conversation
- Add GetDisplayInfo handler for retrieving display information - Implement FindElementOnDisplay and FindElementsOnDisplay for display-specific element location - Add SourceOnDisplay handler for multi-display hierarchy dumping - Create DisplayIdResolver for display index/ID mapping and caching - Extend UiSelectorBuilder with displayId support - Add comprehensive error handling and API level checks - Maintain full backward compatibility with single-display devices"
|
|
I haven't dug into this implementation well yet, but what is the difference between |
|
Hi @KazuCocoa |
could you be more specific about that? Eventually, I agree to @KazuCocoa. There is no need to re-introduce the same functionality twice if it already exists. Consider improving/fixing the existing implementation instead. |
|
Here's my understanding for multi-screen operations, am I doing it right? |
|
No, as the readme, |
|
@mykola-mokhnach got it, thank you for your solutions very much, current i already use this to do, but i mean if we can: not: |
|
Could you share the appium server log with timestamp for both? I assume you might concern about the delay with the extra endpoint call - |
|
@KazuCocoa I'm just raise a question and you have explained it well. I have no more questions, thanks. |
We tested currentDisplayId on our conference hardware device in an HDMI multi-display scenario, but it only returned controls on the primary display. Therefore, we implemented a separate solution to support multi-display control and interaction. |
|
Thank you for checking. Would it be sufficient to use a secondary display on an emulator to test out this multi-display behavior?
[update] |
|
@ccxj I've added some more helpers to address multi-display setups testing. Please check appium/appium-uiautomator2-driver#949 and share your feedback. |

feat: Add multi-display support for Android automation
Description
This PR implements comprehensive multi-display automation capabilities for Android devices, enabling robust testing of foldable phones, external displays, and multi-screen environments.
Technical Changes
New API Endpoints
POST /session/:sessionId/appium/element/on_display- Find element on specific displayPOST /session/:sessionId/appium/elements/on_display- Find multiple elements on displayGET /session/:sessionId/appium/device/display_info- Retrieve display informationGET /session/:sessionId/appium/source/on_display- Get page source from displayCore Enhancements
setDisplayId()method for display context trackingKey Benefits
Testing