--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/qHuojW7upJIJ.
For more options, visit https://groups.google.com/groups/opt_out.
Try reading what Mark wrote about this here:
Can you show us your actual code, fileInput.sendKeys("C:/Users/Demo/Desktop/today.txt"); should not be opening up a dialogue, it should just silently insert the file location and then work when you click on the submit button.
--
Hi,
I encountered the same problem,
i wrote the following command
WebElement fileInput = driver.findElement(By.id("product_imageUploader"));
fileInput.click();
fileInput.sendKeys("C:/bills_cmpy.jpg");
But it is not taking the path
If you have found the solution then please let me also know
Thanks in Advance
Cheers !!
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/JhXURB3l9qkJ.
Hi,
I encountered the same problem,
i wrote the following command
WebElement fileInput = driver.findElement(By.id("product_imageUploader"));
fileInput.click();
fileInput.sendKeys("C:/bills_cmpy.jpg");
But it is not taking the path
If you have found the solution then please let me also know
Thanks in Advance
Cheers !!
On Thursday, 23 August 2012 12:55:52 UTC+5:30, webdriver user wrote:
sendkeys will not work for css based file dialog popup. That is crap.. try autoit kit with java.
When you click on ‘Choose File’ button, OS native file select dialog will be opened. This dialog will not be recognized by your driver, so when uploading any file you should never click on ‘Choose File’ button. Instead, use sendkeys to select the file,
WebElement El = driver.findElement(By.id("'fileUploadField'"));
El.sendKeys("c:\\temp\\test.txt");This will select your file without having to select it through file select dialog. This works flawlessly across all supported drivers.
If you are running your test on grid then you should let your remote driver know that the file is residing on local machine and not remote machine. This can be achieved by setting LocalFileDetector for RemoteWebElement,
WebElement El = driver.findElement(By.id("'fileUploadField'"));
((RemoteWebElement) El ).setFileDetector(new LocalFileDetector());
El.sendKeys("c:\\temp\\test.txt");
Here you are setting local file detector for file upload element, so whenever you use sendkeys on this element, your RemoteWebDriver uses this file detector object to detect the file. If the file is detected then it will be base64 encoded and uploaded to remote server through JSON Wire Protocol and the remote fixed path will be selected as a file path.
Please check my blog http://muthutechno.wordpress.com/2014/07/09/uploading-files-in-selenium-webdriver/
| 9:11 PM (less than a minute ago) |
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/13951a58-17c3-4cb0-908b-8c4fd31be01f%40googlegroups.com.