--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/zaL_w5enGGI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/fd55b12a-f6c9-43da-be48-9dd05caa2a8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To post to this group, send email to seleniu...@googlegroups.com.
I'd venture to say that one reason you're getting little response here is that you're entirely bypassing the WebDriver mechanism for uploading files. The method for uploading files is to use the SendKeys method on the WebElement interface. Of course, that mechanism works only on <input type="file"> elements, and many web developers attempt to replace that mechanism because they incorrectly think they have to.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/zaL_w5enGGI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ae44b2c5-6636-47e6-9411-aee907927c65%40googlegroups.com.
Well, you may be on to something as the element I'm working with is input type "file"....
So, I just have to SendKeys <pathname> and I should be good? I guess I could add an id to the input element as well to make it easier to ..FindBy.Id.Hopefully this is the way to go as I would feel more comfortable with test reliability moving in the direction you suggest.
On Fri, Sep 2, 2016 at 9:27 AM, mawa316 . <maw...@gmail.com> wrote:
The way I've gone the route I have is because the browse window that pops up is a Windows based window and not from our web app.In hunting and pecking around I did see an input type="file" example and it was a browse button that brought up the same Windows File Browse dialog I'm seeing. So, maybe you're right and SendKeys will work.I'll inspect the particular element more and see if I can improve upon the test. Thanks for setting me straight! You may regret that as I'm sure I'll have more questions! :-D
On Thu, Sep 1, 2016 at 9:00 PM, Jim Evans <james.h....@gmail.com> wrote:
I'd venture to say that one reason you're getting little response here is that you're entirely bypassing the WebDriver mechanism for uploading files. The method for uploading files is to use the SendKeys method on the WebElement interface. Of course, that mechanism works only on <input type="file"> elements, and many web developers attempt to replace that mechanism because they incorrectly think they have to.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/zaL_w5enGGI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
The way I've gone the route I have is because the browse window that pops up is a Windows based window and not from our web app.In hunting and pecking around I did see an input type="file" example and it was a browse button that brought up the same Windows File Browse dialog I'm seeing. So, maybe you're right and SendKeys will work.I'll inspect the particular element more and see if I can improve upon the test. Thanks for setting me straight! You may regret that as I'm sure I'll have more questions! :-D
On Thu, Sep 1, 2016 at 9:00 PM, Jim Evans <james.h....@gmail.com> wrote:
I'd venture to say that one reason you're getting little response here is that you're entirely bypassing the WebDriver mechanism for uploading files. The method for uploading files is to use the SendKeys method on the WebElement interface. Of course, that mechanism works only on <input type="file"> elements, and many web developers attempt to replace that mechanism because they incorrectly think they have to.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/zaL_w5enGGI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
for (int i = 0; i < testFiles.Length; i++)
{
driver.FindElementById("fileinput").SendKeys(@"C:\SeleniumTestData\Upload\" + testFiles[i]);}
Much more concise and I learned how to handle an input element in the process!