切换 Selenium 模式后不能获取元素

从 Appium 模式切换到 Selenium 模式不能找到元素信息


    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    if (driver.isAppInstalled("com.pingan.fpm") && driver.findElement(By.name("登录")).isDisplayed()) {
        driver.findElement(By.name("登录")).click();
    }
    if(driver.findElement(By.linkText("用户名不能为空")).isDisplayed()) {
        System.out.println("TestCase运行成功");
    }
}


在 Appium 模式下可以获取到登录按钮的,切换 Selenium 后不能识别,给了 Selenium 端口号,还需要在 Appium 上配置什么吗?
错误信息如下

org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 30.07 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'C07PM0YAG1HW.local', ip: '10.243.243.171', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.8.0_101'
Driver info: io.appium.java_client.android.AndroidDriver

appium 里也有报错,求指点

info: [debug] [SELENDROID ERR] length=58; index=58
info: [debug] [SELENDROID ERR]  at com.lbe.security.service.provider.internal.AppOpsAdapter$1.getDefaultOp(AppOpsAdapter.java:279)
info: [debug] [SELENDROID ERR]  at com.android.internal.app.IOpsCallback$Stub.onTransact(IOpsCallback.java:68)
info: [debug] [SELENDROID ERR]  at android.os.Binder.execTransact(Binder.java:446)```


↙↙↙阅读原文可查看相关链接,并与作者交流