-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Labels
Description
Description
Using Appium 1.6.0, I am unable to use PageObject model successfully, When the test case runs, the element id is translated as k__BackingField instead of myButton.
Environment
- .NET client build version - 2.0.1.1
- Appium server version - 1.6.0
- Desktop OS - Windows 10
- Mobile platform/version under test: Android. Need to try this on iOS.
- Real device or emulator/simulator: BOTH.
Details
Create a sample app that has a button with id, myButton. Use the class below, run the test and you will see in appium logs and eventual exception that the driver is not using the correct id value.
Code To Reproduce Issue [ Good To Have ]
public class TestApplication
{
public TestApplication(AppiumDriver<AppiumWebElement> driver)
{
AppiumPageObjectMemberDecorator decorator = new AppiumPageObjectMemberDecorator();
PageFactory.InitElements(driver, this, decorator);
}
[FindsByIOSUIAutomation(ID = "myButton")]
[FindsByAndroidUIAutomator(ID = "myButton")]
public IMobileElement<AppiumWebElement> MyButton { get; set; }
}
Exception stacktraces
https://gist.github.com/kpanwar/ff5506e40673c7a2ee853e0cb174add7
Link to Appium logs
https://gist.github.com/kpanwar/8fd1e885343e881dfd61f1477a1a6a35