Sign in to follow this  
Followers 0
Nishant

Query Regarding file control

5 posts in this topic

"How to selecta file from file open Dialog Box, on Internet Explorer."

Hi,

I am using autoit-v3 to inject XML file from UI.

I am Not able to do that. Please see the attach file.

I am working on a web based application and using internet browser. I want to select a file. Click on Browse Button and select a file from file dialog box and click open.

After click on open button from the file dialog box select file should copy on the Image 1 (Attachment) XML file box.

I think u understand my query.

Please Help and provide some code to do that

Regards,

Nishant Jain

Share this post


Link to post
Share on other sites



I think u understand my query.

I think not.

Please Help and provide some code to do that

Please provide some code of what you've tried.

I can't see your attachment.

In addition, a URL to the web app , or a screenshot, or something would help.

Have you looked at IE.au3?


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

I think not.

Please provide some code of what you've tried.

I can't see your attachment.

In addition, a URL to the web app , or a screenshot, or something would help.

Have you looked at IE.au3?

------------------------------

I will tell AutoItv3 Example.

Open a browser with the form example, there is a Browse button. I want to click on Browse button and select a file from dialog box. After selection, File name should display on the <input type='file' name='fileExample'> control.

I think u understand what I am Saying.

Till now I write the following script:-

#include <IE.au3>

; Open web site on Internet

$oIE = _IECreate ("http://nksitetest.do")

Send("{ENTER}")

_IELoadWait ($oIE)

; On the web site there is a BROWSE button,

;Click on browse button

$oBrowse = _IEGetObjByName ($oIE, "File")

_IEAction ($oBrowse, "click")

;Select a file and return back to the site

;This code I am not able to write. Please Help

;Finally Form Submition

_IEFormSubmit ($oForm)

Please help me on that. I am strugling from last 1 day. If any thing elase require then Please let me know.

Thanks,

Nishant

Share this post


Link to post
Share on other sites

I suspect that you need to locate the dialog box window and use Send() or ControlSend() to populate the box and click on the button.

pseudo code:

wait for winexists "Choose File"

send ("x:\directory\structure\filename.toupload.text")

send {enter}

I wouldn't mess w/ navigating around the internals of the control, altho people who know the gui functions might be able to point you in the right direction.. You (obviously) know the file you want to send, just put the characters in the box...


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Thanks for your help. But I am not very comfortable with scripting. Can u Plese correct functions for that, so that I will contd with my task. Thanks in advance for your reply.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0