代码之家  ›  专栏  ›  技术社区  ›  bhargav porapu

如何获取selenium中角度标记中的值[复制]

  •  -2
  • bhargav porapu  · 技术社区  · 6 年前

    如何获取html dom中不存在但ui中存在的文本值。 text box present in UI

    html tag for that element or angular

    1 回复  |  直到 6 年前
        1
  •  0
  •   mahan    6 年前

    无论它在哪里,你都可以得到它 input.getAttribute("value") . 你只需要选择输入。

    WebElement input = driver.findElement(By.tagName("app-datepicker"))
                             .findElement(By.tagName("input"));
    String value = input.getAttribute("value");

    我这样做了。 app-datepicker 是AngularJS组件。