0

EDIT: Updated with error I am trying to upload a file using webdriver in Java. I have set up everything but it does not work on Firefox.

WebElement uploadFile = nav.getWebDriver().findElement(FileScreenPage.UploadFileButton);
uploadFile.sendKeys(resourceDirectory.getAbsolutePath() + "/" + organisationName + "/" + FileName);

I tried all the solutions from stack and other websites it still not working.
Above script fails but it works perfect on ChromeDriver.
Could some one please help to fix this problem in firefox browser?
I am using latest 3.14 version of selenium webdriver.

Error: cucumber.runtime.CucumberException: org.openqa.selenium.ElementNotInteractableException: Element is not reachable by keyboard Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z' System info: host: 'ip-172-20-88-189.ap-southeast-2.compute.internal', ip: 'fe80:0:0:0:8f9:2eef:3cae:f8d7%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.3', java.version: '1.8.0_161' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 61.0.2, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 39082, moz:profile: /var/folders/6n/crr9n8x936b..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: MAC, platformName: MAC, platformVersion: 17.4.0, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}} Session ID: 47306e6e-3569-5645-8c70-fc214c2cfdd0

user2805845
  • 53
  • 1
  • 8
  • can you attach the exception when you try to upload the file. Also will be good to post html sample from firefox browser. – Infern0 Nov 07 '18 at 07:16

1 Answers1

0

Try with

WebElement uploadFile = nav.getWebDriver().findElement(FileScreenPage.UploadFileButton);
driver.switchTo().activeElement().sendKeys(path to file);

Another solution is to implement autoit 3 or robot framework upload. There is plenty examples around.

Infern0
  • 2,565
  • 1
  • 8
  • 21