I am trying to upload a file using the WebBrowser control. It trims the starting character sometimes one and sometimes three then choose window gives error Invalid file name!
. Can't seem to do it and need some help.
Here is the Html:
<input name="UploadedFile" id="UploadedFile" type="file" />
<input name="up" id="up" type="button" value="Upload" />
Here is the vb code:
Dim el = elc.GetElementsByName("UploadedFile")
el.Item("UploadedFile").Focus()
' SendKeys.Send("Capture.png" & "{ENTER}")
SendKeys.Send("C:\Capture.png" + "{ENTER}")
el.Item("UploadedFile").InvokeMember("Click")
that the file upload button comes up and hit enter, but can't input full filename into the file name area.
If I use thisSendKeys.Send("C:\Capture.png" + "{ENTER}")
. It gives this error:
Choose window error screenshot
If I use this SendKeys.Send("Capture.png" + "{ENTER}")
. It gives this error:
Choose window error screenshot
And if I put extra character then it works fine but it doesn't always trim one character so I can't put an extra character to solve this error.