我正在尝试使用c#中的Selenium web驱动程序查找元素。
我的代码是:
var pathToLinkGeneral = Driver.FindElement(By.XPath("//div[@class='form-control'][label[text()='Get direct link:']]/input"));
页面中的源代码是:
<div class="form-group">
<label>Get direct link:</label>
<input class="form-control" type="text" style="cursor: auto; value="http:
但我一直有例外-
Message: Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception: OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@class='form-control'][label[text()='Get direct link:']]/input"}
有人能帮忙吗?