Sign in to follow this  
Followers 0
syamay

IEFormImageClick doesn't work

11 posts in this topic

#1 ·  Posted (edited)

Hi All,

I am new here, my problem is I want to click on Image as button on the website.

but when I use

_IEFormImageClick ($oIE, "act_save", "name")

its doesn't send the command and submit my form.

FYI, the form is a IE popup windows with 3 more button.

May I know if there any other way to click at the image maybe via position (x,y)?

If I use mouseclick its working fine, but main issue i didn't know correct image position.

Thanks in advance

Edited by syamay

Share this post


Link to post
Share on other sites



Is your reference to $oIE correct for the popup? How did you get it?

:unsure:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Is your reference to $oIE correct for the popup? How did you get it?

:unsure:

Hi, I use this code.

$oIE = _IEAttach ("AWS - RFO 0.315.centos4")

This is to get link to web that already opened. I believe its correct reference since I able to key in data in input box in that popup form.

I try use TAB and ENTER, its not working too.

But if use MouseClick, its can work, the problem is the location for the button sometimes not same.

Thanks PsaltyDS.

Share this post


Link to post
Share on other sites

It all depends on what kind of IE popup it is. Please make a screenshot of it.

Share this post


Link to post
Share on other sites

Probably should be:

$oIE = _IEAttach ("AWS - RFO 0.315.centos4", "DialogBox")

Run it in SciTE to see the errors in the console pane:

#include <IE.au3>

_IEErrorHandlerRegister()

; ...

$oIE = _IEAttach("AWS - RFO 0.315.centos4", "DialogBox")
$oImg = _IEGetObjByName($oIE, "act_save")
_IEAction($oImg, "click")

:unsure:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hey!

For not to create new topic, may I ask your question here

For example, I have html file "example.htm" :

<html>
<body>
    <form method="post" action="" id="10">
        <input type="hidden" name="qid" value="1" />
        <input type="hidden" name="wid" value="2" />
        <input type="hidden" name="eid" value="3" />
        <input type="hidden" name="rid" value="4" />
        <input type="hidden" name="tid" value="5" />
        <input type="hidden" name="yid" value="6" />
        <input type="hidden" name="uid" value="7" />
        <input alt="picture 1" type="image" src="picture_1.png"     />
    </form>
    <form method="post" action="" id="11">
        <input type="hidden" name="qid" value="1" />
        <input type="hidden" name="wid" value="2" />
        <input type="hidden" name="eid" value="3" />
        <input type="hidden" name="rid" value="4" />
        <input type="hidden" name="tid" value="5" />
        <input type="hidden" name="yid" value="6" />
        <input type="hidden" name="uid" value="7" />
        <input alt="picture 2" type="image" src="picture_2.png"     />
    </form>
</body>
</html>

And my script

#include <IE.au3>
$oIE = _IECreate ("example.htm")
_IEFormImageClick($oIE,"picture 1","alt")
_IEFormImageClick($oIE,"picture_1.png","src")

Don't click on image. Why?

Share this post


Link to post
Share on other sites

You have multiple FORM elements, so pick one, then use $oForm to reference the image:

$oForm = _IEFormGetObjByName($oIE, "10", 0)
_IEFormImageClick($oForm,"picture 1","alt")

:unsure:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

PsaltyDS thank you!

but

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\cheese\Documents\example.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams

+>15:11:39 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0419 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64)

>Running AU3Check (1.54.19.0) from:C:\Program Files (x86)\AutoIt3

+>15:11:39 AU3Check ended.rc:0

>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\cheese\Documents\example.au3"

--> IE.au3 V2.4-0 Error from function _IETagNameGetCollection, $_IEStatus_InvalidObjectType

--> COM Error Encountered in example.au3

----> $IEComErrorScriptline = 1727

----> $IEComErrorNumberHex = 000000A9

----> $IEComErrorNumber = 169

----> $IEComErrorWinDescription = Variable is not of type 'Object'.

----> $IEComErrorDescription =

----> $IEComErrorSource =

----> $IEComErrorHelpFile =

----> $IEComErrorHelpContext =

----> $IEComErrorLastDllError = 0

--> IE.au3 V2.4-0 Warning from function _IEFormImageClick, $_IEStatus_NoMatch

I will still experimenting :unsure:

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Add _IEErrorHandlerRegister() so we can see from the output if it failed to find the form, or failed to find the image element.

:unsure:

Edit: Hmm... the more I look at it, the more it looks like it should find it with $oIE just as easily as $oForm. From the help file under _IEFormImageClick():

Remarks

The <input type=image> form element is handled differently from all others. It is not recognized by Internet Explorer as a member of the form element collection and this function therefore gives you other means of getting a reference to it within the document using src, name or alt strings. Regardless of the object passed to this function, it looks for the form element within the full document context.

:>

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

D'oh! I solved the problem.

I used IE9 64-bit version,

When I use IE8 32-Bit Windows Virtual PC everything is working properly. :unsure:

thx!

Share this post


Link to post
Share on other sites

D'oh! I solved the problem.

I used IE9 64-bit version,

When I use IE8 32-Bit Windows Virtual PC everything is working properly. :huh2:

thx!

WELL!!! After I read this post, I did a quick search for a reason my simple "_IEFormImageClick ($oLogbutt, "Login", "alt")" wasn't working. I had used prev, and forgot that I updated to IE 9 when full version became available. I had to click Compatability mode to get it to work, and set as always use compatibility mode with the site in question for continued success. Has there been any word of an update to get around this without having to use compatibility mode?

P.S I spent 1 week trying to figure this out. I suck BAD!!! Thought I was just having a bad syntax day. :)hahaha

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