Jump to content

Issue with forms on using IE


VegasTom
 Share

Recommended Posts

Hello everyone,

I am new to using Autoit and so far playing with it seems to rock. I need am trying to build a simple application that will have the ability to upload files to a secure webiste using a hidden IE window so that the users dont have to login to the website, navigate to what they need and upload the files.

The script that i am using on the website assigns a differnt session number to the formID on each load so i can not trap the form to process the log in. So for expamle:

the form name is: Samlpeform3093jfnd8, but the only static part is the Sampleform and the 3093jfnd8 changes each time the site loads, any sugestions? I am relitivly new to autoit, but i have some other basic programming knowledge

Thank you

Link to comment
Share on other sites

I've never encountered a site with changing form names, it might be java or something like that that isn't going to play nice if your trying to automate it, but you could try something like this:

$oIE = _IECreate("http://www.cnn.com/")
$oForms = _IEFormGetCollection ($oIE)
MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
For $oForm In $oForms
    ;MsgBox(0, "Form Info", $oForm.name)
    If StringInStr($oForm.name, "local") Then MsgBox(0, "Form Info", "Form Name:  " & $oForm.name & @CRLF & "Form ID:  " & $oForm.id)
Next

cnn.com has a couple forms with local in the name, but you should get the idea. If there is more then one hit (like with cnn) maybe you can use the first or second instance of the form name (see the 3rd example in the helpfile under IEFormGetCollection )

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd
Link to comment
Share on other sites

I've never encountered a site with changing form names, it might be java or something like that that isn't going to play nice if your trying to automate it, but you could try something like this:

$oIE = _IECreate("http://www.cnn.com/")
$oForms = _IEFormGetCollection ($oIE)
MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
For $oForm In $oForms
    ;MsgBox(0, "Form Info", $oForm.name)
    If StringInStr($oForm.name, "local") Then MsgBox(0, "Form Info", "Form Name:  " & $oForm.name & @CRLF & "Form ID:  " & $oForm.id)
Next

cnn.com has a couple forms with local in the name, but you should get the idea. If there is more then one hit (like with cnn) maybe you can use the first or second instance of the form name (see the 3rd example in the helpfile under IEFormGetCollection )

Yes, i just figured it out. I can load the forms in an array then just use the one that i want without all the form ids required. Sorry I am new at this and this is my fist attempt to build an application that actually has a purpose :)

Thank you

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...