How to find an Element in Watin by its tag name?

佐手、 提交于 2019-12-05 04:46:19
Jeroen van Menen

As of WatiN 2.0 beta 1 this has changed to:

ie.ElementWithTag("h1", constraint);

Constraints are created when using the Find.XXX methods.

Here is an example:

ie.ElementWithTag("h1", Find.ByClass("blue");

For example, to find the first <h1> on a page, use:

ie.Element("h1", Find.ByIndex(0))

this is what worked for me:

var element = ie.Element(x => x.Text == "[innerText]" && x.TagName == "[tagname]");

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!