Sindhu
2017-07-24 21:25:16 UTC
*Hi everyone,*
*I am having issue with trying to upload(attach technically) multiple files
at once using sendKeys().*
Browser:* IE11*
Webdriver version*: 2.42.2*
*sendKeys() snippet:*
String pathList = ""C:\\path\\to\\file1" "C:\\path\\to\\file2"
"C:\\path\\to\\file3"";
sendKeys(pathList);
*My file input element is inside a button and it looks like this: *
<div class="button button-select fileinput-button">
Select files from your computer
<input type="file" name="files[]" multiple="">
</div>
*Since it is inside a button** (and looks like hidden)**, sendKeys() is
unable to access the input element.*
*So far I have tried the following solutions:*
*1. Using Javascript to make the input element visible:*
document.getElementsByName('files[]')[0].style.visibility='visible';
document.getElementsByName('files[]')[0].style.display='block';
document.getElementsByName('files[]')[0].style.display='inline';
document.getElementsByName('files[]')[0].style.display=\"block\";
None of the above statements seems to be making the input element visible.
*2. Using Javascript to change the HTML and bring the input element out of
the button:*
This approach is changing the HTML and bringing the input element out of
the button which I can see visibly. And sendKeys() is able to access the
input element and populate the file path input, BUT the files are not
actually getting attached. I manually tried this work around and files get
attached in Chrome and doesn't in IE11. IE11 is the official browser for
our application, so I am looking for solutions to make this work in IE11.
*3. Using webdriver version 2.39.0:*
In this version sendKeys() is able to access the invisble input element.
But, I don't want to use older version.
*Could some PLEASE suggest any solution that would help me. Thanks in
advance!! *
*I am having issue with trying to upload(attach technically) multiple files
at once using sendKeys().*
Browser:* IE11*
Webdriver version*: 2.42.2*
*sendKeys() snippet:*
String pathList = ""C:\\path\\to\\file1" "C:\\path\\to\\file2"
"C:\\path\\to\\file3"";
sendKeys(pathList);
*My file input element is inside a button and it looks like this: *
<div class="button button-select fileinput-button">
Select files from your computer
<input type="file" name="files[]" multiple="">
</div>
*Since it is inside a button** (and looks like hidden)**, sendKeys() is
unable to access the input element.*
*So far I have tried the following solutions:*
*1. Using Javascript to make the input element visible:*
document.getElementsByName('files[]')[0].style.visibility='visible';
document.getElementsByName('files[]')[0].style.display='block';
document.getElementsByName('files[]')[0].style.display='inline';
document.getElementsByName('files[]')[0].style.display=\"block\";
None of the above statements seems to be making the input element visible.
*2. Using Javascript to change the HTML and bring the input element out of
the button:*
This approach is changing the HTML and bringing the input element out of
the button which I can see visibly. And sendKeys() is able to access the
input element and populate the file path input, BUT the files are not
actually getting attached. I manually tried this work around and files get
attached in Chrome and doesn't in IE11. IE11 is the official browser for
our application, so I am looking for solutions to make this work in IE11.
*3. Using webdriver version 2.39.0:*
In this version sendKeys() is able to access the invisble input element.
But, I don't want to use older version.
*Could some PLEASE suggest any solution that would help me. Thanks in
advance!! *
--
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-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2d5ca889-bc1a-4b93-86ad-adbdf8bb538a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2d5ca889-bc1a-4b93-86ad-adbdf8bb538a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.