【问题标题】:Can you automate ui based web app with appium?您可以使用 appium 自动化基于 ui 的 Web 应用程序吗?
【发布时间】:2021-06-23 02:08:19
【问题描述】:

我必须自动化 Web 应用程序的 UI。我还需要在移动设备中自动化 UI。 Appium 是否支持这两个平台??? 任何了解 Appium 的人都可以在下方评论。

【问题讨论】:

  • 我假设您在谈论 UI 自动化测试。在这种情况下,将 Appium 用于移动设备,将 Selenium 用于 Web 应用程序。
  • 是否有任何免费的自动化工具可以同时支持非基于云的网络应用和移动应用的测试

标签: user-interface automation appium ui-automation


【解决方案1】:

是的,Appium 非常适合混合(原生 + 网络)移动应用:

// assuming we have a set of capabilities
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
    System.out.println(contextName); //prints out something like NATIVE_APP \n WEBVIEW_1
}
driver.context(contextNames.toArray()[1]); // set context to WEBVIEW_1

//do some web testing
String myText = driver.findElement(By.cssSelector(".green_button")).click();

driver.context("NATIVE_APP");

// do more native testing if we want

driver.quit();

更多详情请访问docs

【讨论】:

    猜你喜欢
    • 2023-03-14
    • 1970-01-01
    • 2016-02-10
    • 2019-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多