upload file using Webdriver integration

Best practices, code snippets for common functionality, examples, and guidelines.
aidan.mcdonnel
Posts: 8
Joined: Wed Aug 09, 2017 2:11 pm

upload file using Webdriver integration

Post by aidan.mcdonnel » Wed Jan 24, 2018 12:34 pm

Hey

I'm new to Ranorex so easy on me pls :)


Is it possible to recreate the following C#

Code: Select all

_driver = new RemoteWebDriver(new Uri(hub_url),options);
_driver.FileDetector = new LocalFileDetector();
FileWebElement= _driver.FindElement(By.ClassName("inputfile"));
FileWebElement.SendKeys(path);
UploadButton.Click();
Where the HTML is

Code: Select all

<input class="inputfile" type="file" name="file">
I tried to record but Ranorex records the system elements.

Any help is welcome