使用 Selenium for .NET , 如何从 html 输入中获取当前值?
可以通过 .GetAttribute()
获取 value
属性,但这是 html 属性,而不是输入到文本框中的当前值;一种类似于 jQuery 的 .val()
而不是 jQuery 的 .attr()
的方法。
最佳答案
Element.Text
对我不起作用。我使用了 element.GetAttribute("value")
查看此问答 Setting input textbox text and then retrieving it in Specflow & Selenium
关于c# - 如何使用带有 C# 的 Selenium 获取文本输入的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20121302/