My VB6 app has a webbrowser and loads up a webpage. One of the elements on that page is a "browse for local picture and upload" button (inp.type = "file"). Those that you click and then browse for an image on your computer and then submit the form.
I want to automate that process, which was done the following way:
That works nice but requires focus and maximized form to work. Would there be away to do it "stealth"?Code:Web.Document.All("mandatory_picture").focus SendKeys "C:\020.jpg"
I tried the following:
I also tried setting the inp.value of the right element:Code:Web.Document.Forms(1).elements(9).Value = "C:\020.jpg" With Web.Document.All .Item("mandatory_picture").Value = "C:\020.jpg" End With
...because that's what the value for that element shows up when the file is browsed 'normally' from the web page - but it seems I wasn't able to 'set' anything using "inp.value"...Code:inp.Value = "C:\test\020.jpg"
Thank for any input


Reply With Quote

