![](/img/trans.png)
[英]While working with Selenium WebDriver and Java I am not able to use click() function of WebDriver (giving no exception)
[英]Not able to locate the button and use click function: Selenium WebDriver with Java
我无法找到按钮并在使用Java的Selenium Webdriver自动运行的网站中单击它。 有人可以帮忙吗? (使用CSS选择器)
以下是按钮的HTML
<div class="inputWrapper newButton" name="uploadDiv">
<h6 name="fileUpload">
<label for="pdfFileUplod">Upload file</label>
</h6>
<input id="pdfFileUplod" class="fileInput hidden_" type="file" onchange="checkFile = checkFileName(this);" name="uploadFile"/>
</div>
如果您认为文件上传按钮具有ID,请使用它:
WebElement el = driver.findElement(By.Id("pdfFileUplod"));
el.click()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.