0
例如说我有一个标签作为类型:如何获得元素/标签类型的硒C#
<a class = "fp-anchor fp-forgot-password pull-right" href = "/Account/ForgotPassword">Forgot Password?</a> == $0
我试图让元素的类型为这个我指的应该是锚点a
标记。或者更确切地说,我需要确定这是否是超链接。 喜欢的东西,
Driver.FindElement(By.Id("someid")).<whatever selenium webdriver function to identify what type of element it is>
同样,如果它是一个输入标签,说
<input type="text"..../>
它应该确定该标签为input
类型。
任何建议将是很大的帮助。
功能GetTagName oes不会出现在我的情况。 –
@BishwaroopChakraborty,试试这个'TagName'例如'string tagname = Driver.FindElement(By.Id(“someid”))。TagName'让我知道它是否在C#中工作 –