Jump to content



Photo

[solved] Click Submit


  • Please log in to reply
5 replies to this topic

#1 99ojo

99ojo

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 872 posts

Posted 17 November 2009 - 09:53 AM

Hi,

i want to click Submit Button. I'm able to fill Inputs with username and password.
Problems:
1) No Form -> _IEFormSubmit doesn't work.
2) No button defined, so i can't get button id.

;-((
Stefan

SourceCode WebSite:
Spoiler


Code so far:
#include <ie.au3> _tsm () Func _tsm ()     $oIE = _IECreate ("<a href='http://servername:1580' class='bbc_url' title='External link' rel='nofollow external'>http://servername:1580"</a>)     $oFrame = _IEFrameGetCollection ($oIE, 1)     $oUserID = _IEGetObjByName ($oFrame, "USERID")     $oPassword = _IEGetObjByName ($oFrame, "PASSWORD")     _IEFormElementSetValue ($oUserID, "admin")     _IEFormElementSetValue ($oPassword, "xxxxxxxxx") EndFunc

Edited by 99ojo, 17 November 2009 - 01:26 PM.








#2 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 17 November 2009 - 11:54 AM

The form is right here:

<form method="post" action="/SignOnPost">


You can get it by _IEFormGetCollection using an index.

You can also get the button by _IEFormElementGetCollection and an index.

_IEFormSubmit should work fine.

#3 99ojo

99ojo

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 872 posts

Posted 17 November 2009 - 12:35 PM

The form is right here:

<form method="post" action="/SignOnPost">


You can get it by _IEFormGetCollection using an index.

You can also get the button by _IEFormElementGetCollection and an index.

_IEFormSubmit should work fine.

Hi,

thanks for suggestion, but....

If i add this lines after $oIE= ...

$oForm = _IEFormGetCollection ($oIE, 0) -> One form detect, but error in console
MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
-> Message: There are 1 forms on this page.

Then:
$obutton = _IEFormElementGetCollection ($oForm, 9)-> different values from 0 - 9 always error in console.

--> IE.au3 V2.4-0 Warning from function _IEFormGetCollection, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType

#include <ie.au3> _tsm () Func _tsm ()     $oIE = _IECreate ("<a href='http://servername:1580' class='bbc_url' title='External link' rel='nofollow external'>http://servername:1580"</a>)     $oForm = _IEFormGetCollection ($oIE, 0)     $obutton = _IEFormElementGetCollection ($oForm, 9)     ;MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")     $oFrame = _IEFrameGetCollection ($oIE, 1)     $oUserID = _IEGetObjByName ($oFrame, "USERID")     $oPassword = _IEGetObjByName ($oFrame, "PASSWORD")     _IEFormElementSetValue ($oUserID, "admin")     _IEFormElementSetValue ($oPassword, "xxxxxxxxx")     ;_IEFormSubmit ($oForm)     _IEAction ($obutton, "Click") EndFunc


;-((
Stefan

Edited by 99ojo, 17 November 2009 - 12:36 PM.


#4 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 17 November 2009 - 12:39 PM

You have to get the form from inside the frame still, like you do with the other objects.


$oForm = _IEFormGetCollection ($oFrame, 0)

#5 99ojo

99ojo

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 872 posts

Posted 17 November 2009 - 12:47 PM

You have to get the form from inside the frame still, like you do with the other objects.


$oForm = _IEFormGetCollection ($oFrame, 0)

Hi,

thanks a lot. Too much trees in the forest...
IEFormSubmit is working perfectly, so i didn't try to catch the button.

;-))
Stefan

Edited by 99ojo, 17 November 2009 - 12:47 PM.


#6 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 17 November 2009 - 12:53 PM

:) Great. Happy programming.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users