aceishigh
13 years agoContributor
How to Upload a File using Scripting?
Hi There,
I'm trying to automate a File web control. When I click Upload, it opens a file upload screen with a browse button. I browse to the file I want, select it, click OK and the file is uploaded. I'm using IE8 browser and TestComplete 8.5.
I've been trying to do this with xpath and the Text value but this hasn't worked.
Can you tell me what I need to do?
Many Thanks for your time.
J.
HTML:
<input type="file" style="width:85%" size="50" name="extension" id="extension.file.input">
SCRIPT:
BrowseObj = page.EvaluateXPath("//*[@id='extension.file.input']")
BrowseObj(0).Text = "C:\Users\automation\Desktop\VSE 8.8\VIRUSCAN8800.zip"
I'm trying to automate a File web control. When I click Upload, it opens a file upload screen with a browse button. I browse to the file I want, select it, click OK and the file is uploaded. I'm using IE8 browser and TestComplete 8.5.
I've been trying to do this with xpath and the Text value but this hasn't worked.
Can you tell me what I need to do?
Many Thanks for your time.
J.
HTML:
<input type="file" style="width:85%" size="50" name="extension" id="extension.file.input">
SCRIPT:
BrowseObj = page.EvaluateXPath("//*[@id='extension.file.input']")
BrowseObj(0).Text = "C:\Users\automation\Desktop\VSE 8.8\VIRUSCAN8800.zip"