【发布时间】:2022-12-22 18:38:30
【问题描述】:
什么是最好的显式等待在 Appium 中实现?
我知道有3种可能性:
- 使用 wait
FluentWait提供硒 - 使用
WebDriverWait来自硒支持仅在内部扩展FluentWait - 使用Appium的本机
AppiumFluentWait也从FluentWait扩展硒.
我们的框架正在经历一些重大变化,现在是为未来做好准备的最佳时机。
当前的实现正在使用 WebDriverWait 但为此我们必须显式添加 selenium-support 库的导入,因为 Appium 的实现只在运行时导入它。
使用显式导入 selenium-support 库是否存在一些问题,因为 Appium 团队考虑在此范围内添加库导入,AppiumFluentWait 是更好的方法吗?
但是 appium 再次删除了 selenium ex 中的一些常用功能:MobileElement 及其新版本,这种方法将来是否容易被删除?
输出为:mvn dependency:tree
+- io.appium:java-client:jar:8.3.0:compile
[INFO] | +- org.seleniumhq.selenium:selenium-api:jar:4.7.1:compile (version selected from constraint [4.7.0,5.0))
[INFO] | +- org.seleniumhq.selenium:selenium-remote-driver:jar:4.7.1:compile (version selected from constraint [4.7.0,5.0))
[INFO] | | +- com.google.auto.service:auto-service-annotations:jar:1.0.1:compile
[INFO] | | +- com.google.auto.service:auto-service:jar:1.0.1:compile
[INFO] | | | \- com.google.auto:auto-common:jar:1.2:compile
[INFO] | | +- io.netty:netty-buffer:jar:4.1.84.Final:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.84.Final:compile
[INFO] | | | \- io.netty:netty-codec:jar:4.1.84.Final:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.84.Final:compile
[INFO] | | +- io.netty:netty-transport-classes-epoll:jar:4.1.84.Final:compile
[INFO] | | +- io.netty:netty-transport-classes-kqueue:jar:4.1.84.Final:compile
[INFO] | | +- io.netty:netty-transport-native-epoll:jar:4.1.84.Final:linux-x86_64
[INFO] | | +- io.netty:netty-transport-native-kqueue:jar:4.1.84.Final:osx-x86_64
[INFO] | | +- io.netty:netty-transport-native-unix-common:jar:4.1.84.Final:compile
[INFO] | | +- io.netty:netty-transport:jar:4.1.84.Final:compile
[INFO] | | +- io.opentelemetry:opentelemetry-api:jar:1.19.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-context:jar:1.19.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-exporter-logging:jar:1.19.0:compile
[INFO] | | | +- io.opentelemetry:opentelemetry-sdk-metrics:jar:1.19.0:compile
[INFO] | | | \- io.opentelemetry:opentelemetry-sdk-logs:jar:1.19.0-alpha:compile
[INFO] | | | \- io.opentelemetry:opentelemetry-api-logs:jar:1.19.0-alpha:compile
[INFO] | | +- io.opentelemetry:opentelemetry-sdk-common:jar:1.19.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:jar:1.19.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:jar:1.19.0-alpha:compile
[INFO] | | | \- io.opentelemetry:opentelemetry-exporter-common:jar:1.19.0:runtime
[INFO] | | +- io.opentelemetry:opentelemetry-sdk-trace:jar:1.19.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-sdk:jar:1.19.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-semconv:jar:1.19.0-alpha:compile
[INFO] | | +- io.ous:jtoml:jar:2.0.0:compile
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.12.18:compile
[INFO] | | +- org.apache.commons:commons-exec:jar:1.3:compile
[INFO] | | +- org.asynchttpclient:async-http-client:jar:2.12.3:compile
[INFO] | | | +- org.asynchttpclient:async-http-client-netty-utils:jar:2.12.3:compile
[INFO] | | | +- io.netty:netty-codec-socks:jar:4.1.60.Final:compile
[INFO] | | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.60.Final:compile
[INFO] | | | +- io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.60.Final:compile
[INFO] | | | +- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] | | | +- com.typesafe.netty:netty-reactive-streams:jar:2.0.4:compile
[INFO] | | | \- com.sun.activation:jakarta.activation:jar:1.2.2:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-http:jar:4.7.1:compile
[INFO] | | | \- dev.failsafe:failsafe:jar:3.3.0:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-json:jar:4.7.1:compile
[INFO] | | \- org.seleniumhq.selenium:selenium-manager:jar:4.7.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-support:jar:4.7.1:runtime (version selected from constraint [4.7.0,5.0))
[INFO] | +- com.google.code.gson:gson:jar:2.10:compile
[INFO] | +- cglib:cglib:jar:3.3.0:runtime
[INFO] | | \- org.ow2.asm:asm:jar:7.1:runtime
[INFO] | +- commons-validator:commons-validator:jar:1.7:runtime
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.9.4:runtime
[INFO] | | +- commons-digester:commons-digester:jar:2.1:runtime
[INFO] | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | \- commons-collections:commons-collections:jar:3.2.2:runtime
[INFO] | +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] | +- commons-io:commons-io:jar:2.11.0:compile
[INFO] | \- org.slf4j:slf4j-api:jar:2.0.5:compile
【问题讨论】:
标签: selenium automation appium wait appium-java