appium / appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Apache License 2.0
115 stars 24 forks source link

Appium Mac2 driver lose focus when user open dropdown button #276

Open LykashevichAndrei opened 4 months ago

LykashevichAndrei commented 4 months ago

Hello Colleagues

I need to perform a small setup for my tests (this setup should be performed exactly by clicking on browser buttons)

I am using Appium + Mac2Driver

The issue is when i click on chrome languages dropdown menu button appium lose focus on Chrome App and show me XML markdown from my system and not chrome

Example script from appium import webdriver from appium.webdriver.common.appiumby import AppiumBy

For W3C actions

from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.actions import interaction from selenium.webdriver.common.actions.action_builder import ActionBuilder from selenium.webdriver.common.actions.pointer_input import PointerInput

caps = {} caps["appium:platformName"] = "Mac" caps["appium:automationName"] = "Mac2" caps["appium:bundleId"] = "com.google.Chrome" caps["appium:newCommandTimeout"] = 3600 caps["appium:connectHardwareKeyboard"] = "true" caps["appium:noReset"] = True caps["appium:skipAppKill"] = True

driver = webdriver.Remote("http://127.0.0.1:4723", caps)

el1 = driver.find_element(by=AppiumBy.XPATH, value="//XCUIElementTypePopUpButton[@value=\"English\"]") el1.click()

and now i see that button is clicked on the UI

Screenshot 2024-02-09 at 13 11 10

But on the XML markdown i can not see elements from chrome at all

Screenshot 2024-02-09 at 13 15 39

Only system buttons and controls.

Appreciate your assistance here

LykashevichAndrei commented 2 months ago

Situation: in the application i have dialog with some confirmation modals, this modals are not attached to dialog, but to the main app window. And mac2 driver did not see elements on the main app window, only on dialog please see below screenshots win mac2

i had tried it with useDefaultUiInterruptionsHandling: false, but unfortunately, that option did not resolve problem

LykashevichAndrei commented 1 month ago

Just a small note how we resolve this issue.

on front we hit focus on this highest modal and all elements become visible.