AppiumBy is not defined


I’m using appium ispector, the appium ispector gives the code like in the photo, but I can’t use it. code can run if I use code self.driver.find_element("xpath", '//android.widget.ImageButton[@content-desc="2"]').click()

I know that for java client AppiumBy is a new naming so my guess will be that it is new conventional name only available for the new client versions.

Probably your appium inspector has one of the latest versions and when you generate the code with it, it assumes you have a higher python client version. try to check on python client release notes or the relevant API.

also you may want to update your client version.