Jump to content

Problem switching to new window


dgeeb
 Share

Recommended Posts

Hi all,

I'm discovering Autoit and fin it an amazing tool even with my extremely limited programming skills (copy and paste tones...)

I'm creating a form filler but I need to upload a photo: clicking the button to upload is fine but then switching to the open window to Send the path to my file does not work. It blocks just after the _IEAction: when I close that window, the script moves then on. I would love some help on this !

#include <IE.au3>
; for testing purposes #include <MsgBoxConstants.au3>


Call ("login")

Func login ()
Global $oIE = _IECreate ("http://www2.leboncoin.fr/ai/form/3")
Local $Categ = _IEGetObjByName ($oIE, "category")
Local $Region = _IEGetObjByName ($oIE, "region")
Local $Dep = _IEGetObjByName ($oIE, "dpt_code")
Local $Zip = _IEGetObjByName ($oIE, "zipcode")
Local $Name = _IEGetObjByName ($oIE, "name")
Local $Email = _IEGetObjByName ($oIE, "email")
Local $Phone = _IEGetObjByName ($oIE, "phone")
Local $Checkbox = _IEGetObjByName ($oIE, "phone_hidden")
Local $Title = _IEGetObjByName ($oIE, "subject")
Local $Body = _IEGetObjByName ($oIE, "body")
Local $Price = _IEGetObjByName ($oIE, "price")
Local $Button = _IEGetObjByName ($oIE, "validate")
Local $Tof = _IEGetObjByName ($oIE, "image0")



_IEFormElementOptionSelect ($Categ, "20")
_IEFormElementOptionSelect ($Region, "12")
Sleep(1000)
_IEFormElementOptionSelect ($Dep, "77")
Sleep(1000)
_IEFormElementSetValue ($Zip, "77500")
_IEFormElementSetValue ($Name, "xxxxxxx")
_IEFormElementSetValue ($Email, "xxxxx@gmail.com")
_IEFormElementSetValue ($Phone, "0678875565")
_IEAction ($Checkbox, "click")
_IEFormElementSetValue ($Price, "60")
_IEFormElementSetValue ($Title, "yop titre testr")
_IEFormElementSetValue ($Body, "corps du texte type... gogogo ")
_IEAction ($Tof, "click")

; this is for testing purposes WinActivate ("Document1 - Microsoft Word")
; for testing purposes MsgBox($MB_OK, "Is it working?", "Hell no!")
Send ("d:\test.jpg")
_IEAction ($Button, "click")


EndFunc

Thanks a million!

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...