aquality-automation / aquality-appium-mobile-dotnet-template

Template project for aquality-appium-mobile-dotnet library.
https://github.com/aquality-automation/aquality-appium-mobile-dotnet
Apache License 2.0
5 stars 3 forks source link

Need support in handling 'hiding iOS keyboard' and 'iOS Dropdown' using Aquality Appium dot net. #16

Closed aarif313 closed 1 year ago

aarif313 commented 1 year ago

I am working on App automation - Android and iOS.

1- Hiding Keyboard:

For Android I can hide keyboard using below function

public static void HideKeyboard(this IMobileApplication mobileApplication) { Logger.Info("Hiding keyboard"); mobileApplication.Driver.HideKeyboard(); }

When same I use for iOS getting below error Error Message: OpenQA.Selenium.InvalidElementStateException : Error Domain=com.facebook.WebDriverAgent Code=1 "Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test." UserInfo={NSLocalizedDescription=Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.}

2- Dropdown Handling

Requesting you to support on handling dropdown for iOS, For Android I have already managed the same.

mialeska commented 1 year ago

Hi there, regarding your first request, please check out this answer from one of Appium devs: https://github.com/appium/appium/issues/17550#issuecomment-1265932974 According to this, on iOS we can use HideKeyboard only if Done button present on it. A workaround would be to click on other item on screen outside of text area

For dropdowns, my guess is that you will need to open it by tapping on element, then either click on needed item by accessibility id or swiping screen to it

aarif313 commented 1 year ago

Regarding Keyboard Issue: Solved by applying a workaround to click on other item on screen outside of text area.

Regarding DropDown: This is also Solved, For iOS you need to open DropDown by clicking on dopdown element then further need to use SendKeys to select value.

Thanks for your support.