You can do this without injecting JavaScript. You just need to get hold of the form field and type into it. Something like (using the Ruby API):
driver.find_element(:id, 'upload').send_keys('/foo/bar')
More Related Contents:
- Selenium C# WebDriver: Wait until element is present
- C# Selenium ‘ExpectedConditions is obsolete’
- How to select an option from drop down using Selenium WebDriver C#?
- Selenium stops when browser is manually interrupted
- Best way to take screenshots of tests in Selenium 2?
- Webdriver How to wait until the element is clickable in webdriver C#
- How do I make Chrome Headless after I login manually
- How to locate and click on an element which is nested within multiple frame and frameset through Selenium using Webdriver and C#
- How to set Chrome preferences using Selenium Webdriver .NET binding?
- Selenium WebDriver C# Full Website Screenshots With ChromeDriver and FirefoxDriver
- How to execute Selenium Chrome WebDriver in silent mode?
- How to ignore ssl_client_socket_impl.cc(1061)] handshake failed in selenium c# ChromeDriver
- Selenium WebDriver throws Timeout exceptions sporadically
- Selenium WebDriver and browsers select file dialog
- OpenQA.Selenium.WebDriverException: ‘Cannot start the driver service on http://localhost:20548/’
- How do I use Selenium in C#?
- How can I run an EXE program from a Windows Service using C#?
- How to set ASPNETCORE_ENVIRONMENT to be considered for publishing an ASP.NET Core application
- C# Using Reflection to copy base class properties
- Non-blocking file copy in C#
- asp.net MVC 4 multiple post via different forms
- Delegate caching behavior changes in Roslyn
- C# string replace
- Print RDLC Report without showing ReportViewer Control
- ASP.NET Core v2 (2015) MVC : How to get raw JSON bound to a string without a type?
- How to POST request using RestSharp
- Entity framework: StoreGeneratedPattern=”Computed” property
- Azure – Unhandled Exception: System.IO.FileNotFoundException
- How to get random values from array in C# [duplicate]
- Limit binding updates per second