【问题标题】:How can one get the value of a text input using Selenium with C#?如何使用 Selenium 和 C# 获取文本输入的值?
【发布时间】:2014-09-17 22:51:56
【问题描述】:

使用Selenium for .NET,如何从 html 输入中获取当前值?

.GetAttribute() 可以得到value 属性,但这是html 属性,而不是文本框中输入的当前值;一种类似于 jQuery 的 .val() 而不是 jQuery 的 .attr() 的方法。

【问题讨论】:

标签: c# .net selenium-webdriver


【解决方案1】:

Element.Text 对我不起作用。我用element.GetAttribute("value")

查看此问答 Setting input textbox text and then retrieving it in Specflow & Selenium

【讨论】:

    猜你喜欢
    • 2014-06-29
    • 1970-01-01
    • 2015-11-12
    • 1970-01-01
    • 2012-12-09
    • 2021-12-20
    • 2014-10-24
    • 2015-06-17
    相关资源
    最近更新 更多