Skip to content
Advertisement

how to convert findElementByAndroidUIAutomator in Page Factory Format for Appium

I am currently designing Appium Android framework based on page object and page Factory.

I have a below line of code which uses “findElementByAndroidUIAutomator”.

JavaScript

I wanted to convert it to page Factory format like below example.

JavaScript

As I checked I didn’t not find any definite answers regarding this. Just wanted to check as findElementByAndroidUIAutomator is android function not appium. So how can we convert this line to page factory format ?

Advertisement

Answer

You can do it this way:

JavaScript

The only downside is that you can’t pass argument (“e.g Brazil”) to annotation

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement