Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LykashevichAndrei opened this issue Feb 9, 2024 · 2 comments
Open

Comments

@LykashevichAndrei
Copy link

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
Copy link
Author

  • here
    findout that this issue is actual even for some modals that are not attached to main screen.

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
Copy link
Author

Just a small note how we resolve this issue.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant