0

I am a beginner programmer making programs using c# and selenium. I want to know how to type a word from the clipboard and press enter in the file open window using c# and selenium.

I don't know what element to find the file open window.

enter image description here

Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92
muniis
  • 1
  • 1
  • There should be a duplicate on this site some place. This is a common question, but honestly I couldn't find one in a quick search. Can you show a representative snippet of the HTML Selenium is interacting with? I can for sure tell you that Selenium cannot do anything with the "Choose File" dialog. – Greg Burghardt Nov 09 '22 at 21:37
  • 1
    Does this answer your question? [Automating File Upload with Selenium Webdriver](https://stackoverflow.com/questions/28107292/automating-file-upload-with-selenium-webdriver) – Greg Burghardt Nov 09 '22 at 21:52
  • no. I want to automatically paste the contents of the clipboard to the place where I put the file name and send enter. – muniis Nov 10 '22 at 11:47
  • Ok. Honestly it partially answers your question, though. You need to use `IWebElement.SendKeys(string)` to set the value. The trick is to paste from the clip board. – Greg Burghardt Nov 10 '22 at 11:55
  • You will need to [edit] your question to include the HTML you are working with, otherwise we cannot answer your question. – Greg Burghardt Nov 10 '22 at 11:56
  • Thank you for the reply. I will do my best to solve this problem. – muniis Nov 11 '22 at 18:01

0 Answers0