We need not to be panic for not seeing dialog, because our work is to upload file, but not handling dialog. Also note that, in this way upload dialog won't display. The above case will work irrespective of the HTML input field state (enabled / disabled ). ndKeys("C:\\Users\\Fayaz\\Desktop\\") //sending keys WebElement uploadFile = driver.findElement(By.cssSelector("input#troubleshooting-restore-file")).click() //clicking the element Then we can simply pass the location of the file to be upload before clicking the Restore / Browser buttonÄriver.findElement(By.cssSelector("input#troubleshooting-restore-file")).sendKeys("C:\\Users\\Fayaz\\Desktop\\") // sending keys directly In web driver, locate the element with tag perhaps like, Inorder to handle upload dialog selenium web driver is able to handle only when the browse button is of type HTML, if it is windows native dialog then we have to use AutoIT as explained below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |