我已经为iOS和Android的本机应用程序创建了页面对象模型/模式框架 . 执行时的脚本能够定位iOS元素,但它不能识别Android移动元素 .
以下是登陆页面的代码 -
public class LandingPage {
public LandingPage(AppiumDriver driver){
PageFactory.initElements(new AppiumFieldDecorator(driver),this);
}
@AndroidBy(id="com.xyz.app.debug:id/skip")
@iOSFindBy(accessibility="SKIP")
public MobileElement landingScreenSkip;
public void clickLandinSkip(){
landingScreenSkip.click();
}
Below is the code of test class-
public class Login extends BaseTestClass{
@Given("^I open the app$")
public void i_open_the_app() throws Throwable {
setUp();
LandingPage landingObj = new LandingPage(driver());
landingObj.clickLandinSkip();
环境java客户端 - 6.1.0 Appium服务器 - 版本1.6.3(1.6.3)桌面操作系统 - Mac 10.13.6 Node.js版本 - v10.8.0移动平台/待测版本:Nexus 6P / Android 7.1.1模拟器appium -server-logs.txt Error.txt