Jump to content
Sign in to follow this  
cwem

handicapped IE functions....?

Recommended Posts

cwem

It's known that _IEFormSubmit will become handicapped when "some form processing relies on the "value" of the submit button being passed along with the rest of the form data (often when there is more than one submit button in the form and they are designed to trigger different results). This function will not result in a submit button value being passed. The solution is to use the "click" action of _IEAction() as above."

However, when I go to _IEAction help, it doesn't tell how to SELECT the button that I (_IEAction) need to click.

Ok, if I resort to something like:

$oSubmit = _IEFormElementGetCollection ($oForm, 1)

MsgBox(0,@error,@error)

_IEAction ($oSubmit, "click")

MsgBox(0,@error,@error)

so to choose the 2nd button on the page, nothing happens and @error is equal to 0.

So is there any suggestion to work with this problem?

Million thanks!

Share this post


Link to post
Share on other sites
oMBRa

you have to get a reference to the button object, then you can do _ieAction... or you could use _IELinkClickByText

Edited by oMBRa

Share this post


Link to post
Share on other sites
cwem

you have to get a reference to the button object, then you can do _ieAction... or you could use _IELinkClickByText

Thanks for your advice~~~

_IELinkClickByText does not work because it's a button

_ieAction doesn't work because both buttons use the same name "submit" with different values, which are not recognized by AutoIt.

Share this post


Link to post
Share on other sites
cwem

Thanks for your advice~~~

_IELinkClickByText does not work because it's a button

_ieAction doesn't work because both buttons use the same name "submit" with different values, which are not recognized by AutoIt.

After a closer examination, I discover that:

$oForm = _IEFormGetCollection($oIE, 0)

_IEFormElementRadioSelect ($oForm, 3, "seqStat", 1, "byIndex")

$targetTextObj = _IEFormElementGetObjByName($oForm, "sequenceName")

_IEFormElementSetValue ($targetTextObj, $rsnum)

$oSelect = _IEFormElementGetObjByName ($oForm, "group")

_IEFormElementOptionselect ($oSelect, "all", 0, "byText")

_IEFormSubmit($oForm)

; work very fine above, submit, a new window pops up

$oIE = _IEAttach ("Patch")

$oForm = _IEFormGetCollection($oIE, 1)

$targetTextObj = _IEFormElementGetObjByName($oForm, "searchName")

_IEFormElementSetValue ($targetTextObj, $rsnum)

; ok, still able to set value in the new form of a new window

_IEFormSubmit($oForm)

; fails, unable to submit form

Share this post


Link to post
Share on other sites
oMBRa

post your link... and try debugbur(IE) or firebug(firefox)

Share this post


Link to post
Share on other sites
DaleHohm

It's known that _IEFormSubmit will become handicapped when "some form processing relies on the "value" of the submit button being passed along with the rest of the form data (often when there is more than one submit button in the form and they are designed to trigger different results). This function will not result in a submit button value being passed. The solution is to use the "click" action of _IEAction() as above."

However, when I go to _IEAction help, it doesn't tell how to SELECT the button that I (_IEAction) need to click.

Ok, if I resort to something like:

$oSubmit = _IEFormElementGetCollection ($oForm, 1)

MsgBox(0,@error,@error)

_IEAction ($oSubmit, "click")

MsgBox(0,@error,@error)

so to choose the 2nd button on the page, nothing happens and @error is equal to 0.

So is there any suggestion to work with this problem?

Million thanks!

You say "nothing happens". In fact if @error is 0, then the .click method did "happen" on the $oSubmit object. It may not have been the correct object or there may be more requirements imposed by the programming on the page than just an onclick event (for example, one page I automate has a Javascript attached to the submit button that also requires an "onmousedown" event prior to the click).

I suggest that you use _IEPropertyGet outerhtml to insure you have the object you expect. Then suggest you need to really dig into any Javascript attached to the button or the Form to see if there are any other obscure requirements.

Dale

Edit: typo

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
cwem

post your link... and try debugbur(IE) or firebug(firefox)

After one week effort, I'm unable to post direct link and therefore please select subtype "A" in "Sequence information" and then click search at:

http://www.hiv.lanl.gov/components/sequenc...rch/search.html

after waiting for a while, a result page shows up, and the 2nd form contains the button that I want to click.

Unfortunately, as shown in the following source, the 3rd button "Save Background Info" that I want to click does not have a name and therefore I'm unable to click it.

<input value="Make Tree" type="button"

onclick = "showElt('both'); showElt('tree'); hideElt('down'); hideElt('save')"> &nbsp;

<input value="Download Sequences" type="button"

onclick = "showElt('both'); hideElt('tree'); hideElt('down'); showElt('save')"> &nbsp;

<input value="Save Background Info" type="button"

onclick = "showElt('both'); hideElt('tree'); showElt('down'); hideElt('save')"> &nbsp;

<input type="submit" name="make_histo" value="Make Histogram"> &nbsp;

<input type="submit" name="make_geo" value="Geography"> &nbsp;

<input value="Clear" type="button"

onclick = "hideElt('both'); hideElt('tree'); hideElt('down'); hideElt('save')">

Share this post


Link to post
Share on other sites
DaleHohm

This code seems to work just fine:

#include <IE.au3>

$oIE = _IEAttach("http://www.hiv.lanl.gov/components/sequence/HIV/search/search.comp", "url")

$oForm = _IEFormGetCollection($oIE, 1)
$oButton = _IEFormElementGetCollection($oForm, 2)
_IEAction($oButton, "click")

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
cwem

This code seems to work just fine:

#include <IE.au3>

$oIE = _IEAttach("http://www.hiv.lanl.gov/components/sequence/HIV/search/search.comp", "url")

$oForm = _IEFormGetCollection($oIE, 1)
$oButton = _IEFormElementGetCollection($oForm, 2)
_IEAction($oButton, "click")

Dale

Hi Dale,

Are you using WinXP SP3, IE 7.05730.13, AutoIt3?

The program exits smoothly (without warning/error messages if running in debug mode) but without clicking anything. If the clicking succeeds, a window will pop up and ask you to save a file, is that your case? thanks once again for your follow-up :)

Share this post


Link to post
Share on other sites
DaleHohm

Not a "popup", but rather a new section appears on the page that looks something like this:

Background information options

Download the tab-delimited results; 

O Include the sequence 

                      OK      Reset

Dale

p.s. I rather dislike the name you gave this thread


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
cwem

Not a "popup", but rather a new section appears on the page that looks something like this:

Background information options

Download the tab-delimited results; 

O Include the sequence 

                      OK      Reset

Dale

p.s. I rather dislike the name you gave this thread

Dale, you are correct. All I have to do is to enable activeX to make AutoIt work!

The info can be found at:

http://au.answers.yahoo.com/question/index...24071010AAJuIbo

Share this post


Link to post
Share on other sites
cwem

<td align="left" valign="baseline">345</td><td align="left" valign="baseline">HIV-1</td></tr></table><p> <input type="hidden" name="id" value="ee21a58919a623a4e5b30dbadf00b12d">

<input type="image" src="images/next.png"

title="Next" alt="Next" name="action Next">

<input type="image" src="images/last.png"

title="Last" alt="Last" name="action Last">

According to the last few lines of the result page, I use

oSubmit = _IEFormElementGetObjByName ($oForm, "action Next")

_IEAction ($oSubmit, "click")

_IELoadWait ($oIE)

but it says:

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

--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType

Is image unable to be referred in this way?

Share this post


Link to post
Share on other sites
DaleHohm

See _IEFormImageClick

Read the remarks section for more information.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.