![](/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.