-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Labels
Description
Description
AppiumDriver doesn't seem to work with PageFactory on properties of abstract class.
But
In IWebDriver, PageFactory works normally even in the properties of abstract classes.
Environment
OS: Windows 10
Project: NET Core 3.0
Appium.WebDriver: 4.1.1
NUnit: 3.12.0
Code To Reproduce Issue [ Good To Have ]
`
public abstract class BaseClass
{
public AppiumWebDriver<AppiumWebElement> Driver;
[FindsByAndroidUIAutomator(XPath = "//*[@resource-id='com.race981.app:id/toolbarMain']/android.widget.ImageButton")]
public IWebElement BaseMenuBtn { get; set; }
public BaseClass(AppiumDriver<AppiumWebElement> driver)
{
Driver = driver
PageFactory.InitElements( Driver, this,
new AppiumPageObjectMemberDecorator(
new TimeOutDuration(TimeSpan.FromSeconds(10))));
}
}
`
`
public class A : BaseClass
{
[FindsByAndroidUIAutomator(XPath = "//*[@resource-id='com.test.app:id/toolbarMain']/android.widget.ImageButton")]
private IWebElement MyMenuBtn { get; set; }
public A (AppiumDrvier<AppiumWebElement> driver) : base(driver)
{
}
pulbic void Test()
{
BaseMenuBtn .Click(); -> Thorw TimeOutException(); 10Sec
MyMenuBtn.Click() -> Is success.
}
}
`
Exception stacktraces
TimeOutException(); 10Sec