Could anyone please help me, I am still not able to resolve the issue with page factory.
The question may be so basic, Please answer.
Can we have the WebElement and Android Element in the same page and initialize the page using AppiumFieldDecorator.
I am trying in that way and not working , I am not sure whether this is correct. below is the code i used in the page.
The same element i am identifying using the below in same page
public class SelectArea extends BaseClass {
@FindBy(id="com.talabat:id/search_ar") private WebElement txtSearchAr;
@AndroidFindBy(id="com.talabat:id/search_ar") private AndroidElement txtSearchArAndroidBy;
//and initialize the page by constructor as
public SelectAr(AndroidDriver TestDriver)
{
driver =TestDriver;
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
......
}
}
And driver initialized as
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Issue I am getting is
java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Ljava/util/function/Function;)Ljava/lang/Object;
at io.appium.java_client.pagefactory.AppiumElementLocator.waitFor(AppiumElementLocator.java:91)
at io.appium.java_client.pagefactory.AppiumElementLocator.findElement(AppiumElementLocator.java:112)
at io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement.intercept(InterceptorOfASingleElement.java:61)
at io.appium.java_client.android.AndroidElement$$EnhancerByCGLIB$$c0b591f0.replaceValue()
Thank You.