简体   繁体   中英

Selenium(Java) : click() is not clicking the button,it is just selecting.Any other way?

Selenium webdriver using click() is not clicking the button "upload File". I am able to identify the button using xpath but some how unable to click it. Is there any other method to do so?

For uploading file use sendKeys, in sendkeys send your file path

Ex:

driver.findElement(By.xpath("//myxpath")).sendKeys("C:\\drive\\NewTextDocument.txt");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM