I am using MSHTML in automation IE. One of my requirements is to upload a file, and I am able to click the Browse button using the click() method HTMLInputElement.
However, after calling click(), the program does not exit the said method and it is seemingly stuck there indefinitely, unless I manually handle the File Upload popup.
Is there a fix to this or is there an alternative way to upload files using MSHTML?
Here is my code below:
HTMLInputElement browseFile = (HTMLInputElement)cimsDocument.getElementById("file");
browseFile.click(); //my program does not exit from this method
SendKeys.SendWait(@"C:\Users\Test\Desktop\FileToUpload.zip");