【发布时间】:2016-05-12 17:47:58
【问题描述】:
我正在尝试在表单中找到一个按钮...但它没有找到它... 我尝试过使用 threading.sleep(5000);但它没有帮助。 我尝试了很多方法,但没有任何帮助它总是说它无法找到按钮...... 这是我的代码:
IWebElement startb2 = driver.FindElement(By.XPath("//form/*[@name='start']"));
这是表单的html代码:
<form method="post" action="php/PickFruits.php">
<input type="submit" name="start" value="התחל לקטוף" class="button_submit" style="margin-right:-97px;">
</form>
我不想使用该值,因为它是希伯来语...我不能在 c# 控制台中使用它...请帮帮我。
编辑:
现在它找到了输入的位置,但它没有点击它...代码:
IWebElement startb = driver.FindElement(By.XPath("//*[@type='submit']"));
startb.Click();
【问题讨论】:
-
试试 xpath = '//*[@type="submit"]'
-
它工作但它没有点击它:l 代码:IWebElement startb = driver.FindElement(By.XPath("//*[@type='submit']")); startb.Click();
-
点击时是否出现错误?
-
在执行点击操作之前尝试添加一些延迟。
-
我添加了但仍然没有:l