appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.22k stars 758 forks source link

What is the replacement call for the driver.findElementByAccessibilityId("<acc_id_value") in java-client 8.5 release ? #1931

Closed vnuta9 closed 1 year ago

vnuta9 commented 1 year ago

Description

Moving code from prior to java-client ver8.00 to ver8.5. I have statements like driver.findElementByAccessibilityId("slider1") It has to work for both Android and iOS devices, because our app is written as a Flutter app. I am aware that now the present webdriver is the direct sub class of RemoteWebDriver. But I could not find a equivalent method like findElementByAccessibilityId in RemoteWebDriver class or AppiumDriver classes.

Environment

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

Please remember: it's easier to reproduce and fix the bug with sample code. You can git clone https://github.com/appium/appium/tree/master/sample-code or https://github.com/appium/appium/tree/master/sample-code/apps and reproduce an issue using Java and sample apps. Also you can create a gist with pasted java code sample or put it here using markdown. About markdown please read Mastering markdown and Writing on GitHub

Exception Stacktraces

Please create a gist with the pasted stacktrace of the exception thrown by java.

Link To Appium Logs

Please create a gist which is a paste of your full Appium logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read! If you are reporting a bug, always include Appium logs as linked gists! It helps to define the problem correctly and clearly.

valfirst commented 1 year ago

Please check migration guide: https://github.com/appium/java-client/blob/master/docs/v7-to-v8-migration-guide.md#elements-lookup