0

I am trying to upload an image but there is no input type available.

The button that opens a OX dialog is:

//button[@ng-model='singleFileUpload']

The code: [![enter image description here][1]][1]

[1]:

I tried things as described in the following topics but they dont work for me: Webdriver: File Upload c# selenium to browse and upload a file How to upload file/ handle window using Selenium web driver

Thanks for your help.

xxx2017
  • 207
  • 1
  • 5
  • 15
  • Please read why [a screenshot of code is a bad idea](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). Paste the code and properly format it instead. – JeffC Sep 19 '17 at 17:25

1 Answers1

0

I don't know how the button archive that, maybe there is a hidden input type=file element, when you click on the button, it will communicate with the hidden input file element. So give a try to find hidden input file element, If find, try to below code:

driver.executeScript("arguments[0].value=arguments[1]", hidden_inpyt_file, upload_file_absolute_path);
yong
  • 13,357
  • 1
  • 16
  • 27