You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not able to call PageFactory with a Class (Only with "this") #76
Activity
lolemouine commentedon Aug 1, 2014
PageFactory.initElements(new AppiumFieldDecorator(myDriver), TheClassImUsingRightNow.class);
Or
PageFactory.initElements(new AppiumFieldDecorator(myDriver), AnotherClass.class);
wouldn't work...
TikhomirovSergey commentedon Aug 1, 2014
Hi!
You are using Selenium PageFactory class. It has no method with these parameters:
FieldDecorator
Class of Page Object.
Please see here: https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/support/PageFactory.java
What does method that you are trying to invoke:
So. If you want to use AppiumFieldDecorator, you should prepare an instance of your PageObject.class whose fields have to be decorated.
or
TikhomirovSergey commentedon Aug 1, 2014
I am sorry for confusion :)
I made a little improvement here: #68
Decorator that I made is useful when browser, Android or iOS UI have different locators.
So, if you don't want to multiply your classes:
@AndroidFindBy
@iOSFindBy
@findby
Webelement
AppiumFieldDecorator decorates fields marked by @AndroidFindBy, @iOSFindBy and @findby too.
TikhomirovSergey commentedon Aug 1, 2014
#73