Jump to content
Sign in to follow this  
JimPollard

_IE Functions can't seem to find form object

Recommended Posts

JimPollard

I have a web page that has 3 forms and I'm trying to press a "GO" button that appears to be an image. I've posted the html source below. I'm able to see the 3 forms and the "select" element in the form I'm interested in. I've tried every _IE "collection" function but can't seem to find any way to access that "GO" button reliably.

<table>
<tr><td style="vertical-align:bottom"><form name="PC_7_0_1BS_YourRole" method="post" action="/wps/myportal/!ut/p/kcxml/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4i3dAHJgFjGpvqRqCKOcIEgfW99X4_83FT9AP2C3NCIckdHRQCpLJzA/delta/base64xml/L0lDU0lKQ1RPN29na21DU1Evb0tvUUFBSVFnakZJQUFRaENFSVFqR0VKemdBIS80SkZpQ28wZWgxaWNvblFWR2hkLXNJZDJFQSEh
LzdfMF8xQlMvMTM1Mjg1Mi9zYS5zcGZfQWN0aW9uTGlzdGVuZXI!?PC_7_0_1BS_spf_strutsAction=!2fMachinePortlet!2fchooseRole.do#7_0_1BS">Your role: <select name="PC_7_0_1BS_yourRole" title="your role"><option value="Person responsible">Person responsible</option>

<option value="Delegate">Delegate</option></select>

<input type="image" name="submit" src="https://w3.ibm.com/ui/v8/images/btn-go-light.gif" value="Action" alt="GO" style="vertical-align:bottom"></form></td></tr>
<tr><td style="vertical-align:bottom">Your search criteria: <b>All assets</b>; (<a href="/wps/myportal/!ut/p/kcxml/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4i3dAHJgFjGpvqRqCKOcIEgfW99X4_83FT9AP2C3NCIckdHRQCpLJzA/delta/base64xml/L0lDU0lKQ1RPN29na21DU1Evb0tvUUFBSVFnakZJQUFRaENFSVFqR0VKemdBIS80SkZpQ28wZWgxaWNvblFWR2hkLXNJZDJFQSEh
LzdfMF8xQlMvMTM1Mjg1My9zYS5zcGZfQWN0aW9uTGlzdGVuZXI!?PC_7_0_1BS_spf_strutsAction=!2fMachinePortlet!2fchangeQuery.do#7_0_1BS">Advanced search</a>)</td></tr>
</table>

Share this post


Link to post
Share on other sites
JimPollard

$url = "Thanks for including the url smartass.. Now I can test it. :)"

$oIE = _IECreate($url)

$oButton = _IEGetObjByName($oIE,"submit")

_IEAction($oBUtton,"click")

Generally works for me..

Yes, that seems to work ... thank you.

Share this post


Link to post
Share on other sites
DaleHohm

There's nothing wrong with that approach, but the function designed for that control is _IEFormImageClick

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
DaleHohm

There's nothing wrong with that approach, but the function designed for that control is _IEFormImageClick

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  

×