Jump to content

Click a button with the same name, class, type as 3+ others on the page


Klexen
 Share

Recommended Posts

The link to the source code of the site is here...

CODE

http://rafb.net/p/YgnWtN46.html

<td style="text-align:right; width:50%;"><input class="button" type="submit" name="btnSubmit" value="Continue" tabindex="26"></td>

<td style="text-align:left; width:50%;"><input class="button" type="submit" name="btnSubmit" value="Exit" tabindex="27"></td>

I need to click the CONTINUE button.

Edited by Klexen
Link to comment
Share on other sites

Have you tried the _IE* functions?

Yeah. I tried

....

$oSubmit = _IEGetObjByName($oIE, "btnSubmit")

_IEAction($oSubmit,"click")oÝ÷ ØÚ ¡:âyÖ®¶­sbb33c¶ôf÷&ÒÒôTf÷&ÔvWD6öÆÆV7Föâb33c¶ôR ¥ôTf÷&Õ7V&ÖBb33c¶ôf÷&Ò

No go...

It just refreshed the page, and does nothing.

Link to comment
Share on other sites

  • Moderators

$oIE = _IEAttach(etc..)

Then do what you want.

If you refreshed, you probably lost your object.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

$oIE = _IEAttach(etc..)

Then do what you want.

If you refreshed, you probably lost your object.

Well it doesnt exactly refresh, that was a bad way of putting it. You hear a click, but nothing happens. If you click "Continue" something happens. I tried _IEAttach, and it still does not work.

Edited by Klexen
Link to comment
Share on other sites

  • Moderators

Well it doesnt exactly refresh, that was a bad way of putting it. You hear a click, but nothing happens. If you click "Continue" something happens. I tried _IEAttach, and it still does not work.

Show your code then... I'm not going to guess.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Show your code then... I'm not going to guess.

$sURL = "https://www.srpnet.com/Default.aspx"
$sAccountType = "Electric"
$sUsername = ""
$sPassword = ""

$oIE = _IECreate($sURL)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IELoadWait($oIE)

$oAccountType = _IEGetObjById($oIE, "LoginControl1_ddlLoginAcctType")
$oAccountUser = _IEGetObjById($oIE, "LoginControl1_txtID")
$oAccountPass = _IEGetObjById($oIE, "LoginControl1_txtPassword")
$oSubmit = _IEGetObjById($oIE, "LoginControl1_btnLogin")

_IEFormElementSetValue($oAccountType, $sAccountType)
_IEFormElementSetValue($oAccountUser, $sUsername)
_IEFormElementSetValue($oAccountPass, $sPassword)
_IEAction($oSubmit, "click")
_IELoadWait($oIE)

$nURL = "https://secure.srpnet.com/echex/htm/form.asp?lang=eng&type=pwr&com=0"
_IENavigate($oIE,$nURL)

_IEAttach($oIE, "SRP: Pay your bill online via e-Chex")


$sFirstName = ""
$sLastName  = ""
$sPhoneNumber  = ""
$sAccountNumber1 = ""
$sAccountNumber2 = ""
$sAccountNumber3 = ""
$sPaymentAmount = InputBox("Payment Amount","How much would you like to pay?","","",75,75)
$sHouseNumber = ""

$sRoutingNumber = ""
$sCheckingNumber = ""
$sNameonCheck = ""
$sAddressonCheck = ""
$sCityonCheck = ""
$sZipCodeonCheck = ""
$sEmail = ""

$oFirstName = _IEGetObjByName($oIE, "ffFirstName")
$oLastName  = _IEGetObjByName($oIE, "ffLastName")
$oPhoneNumber  = _IEGetObjByName($oIE, "ffPhoneNumber")
$oAccountNumber1 = _IEGetObjByName($oIE, "display1ffAccountNumber_1")
$oAccountNumber2 = _IEGetObjByName($oIE, "display2ffAccountNumber_1")
$oAccountNumber3 = _IEGetObjByName($oIE, "display3ffAccountNumber_1")
$oPaymentAmount = _IEGetObjByName($oIE, "ffPaymentAmount_1")
$oHouseNumber = _IEGetObjByName($oIE, "ffHouseNumber_1")


$oRoutingNumber = _IEGetObjByName($oIE, "ffBankABA")
$oCheckingNumber = _IEGetObjByName($oIE, "ffBankAccountNumber")
$oNameonCheck = _IEGetObjByName($oIE, "ffBankAccountName1")
$oAddressonCheck = _IEGetObjByName($oIE, "ffAddress")
$oCityonCheck = _IEGetObjByName($oIE, "ffCity")
$oZipCodeonCheck = _IEGetObjByName($oIE, "ffZip")
$oEmail = _IEGetObjByName($oIE, "ffEmail")
$oEmail2 = _IEGetObjByName($oIE, "ffEmailc")

_IEFormElementSetValue($oFirstName, $sFirstName)
_IEFormElementSetValue($oLastName, $sLastName)
_IEFormElementSetValue($oPhoneNumber, $sPhoneNumber)
_IEFormElementSetValue($oAccountNumber1, $sAccountNumber1)
_IEFormElementSetValue($oAccountNumber2, $sAccountNumber2)
_IEFormElementSetValue($oAccountNumber3, $sAccountNumber3)
_IEFormElementSetValue($oPaymentAmount, $sPaymentAmount)
_IEFormElementSetValue($oHouseNumber, $sHouseNumber)

_IEFormElementSetValue($oRoutingNumber, $sRoutingNumber)
_IEFormElementSetValue($oCheckingNumber, $sCheckingNumber)
_IEFormElementSetValue($oNameonCheck, $sNameonCheck)
_IEFormElementSetValue($oAddressonCheck, $sAddressonCheck)
_IEFormElementSetValue($oCityonCheck, $sCityonCheck)
_IEFormElementSetValue($oZipCodeonCheck, $sZipCodeonCheck)
_IEFormElementSetValue($oEmail, $sEmail)
_IEFormElementSetValue($oEmail2, $sEmail)

;~ $oSubmit = _IEGetObjByName($oIE, "btnSubmit")

;~ _IEAction($oSubmit,"click")

;~ $oForm = _IEFormGetCollection($oIE, 0)

;~ _IEFormSubmit($oForm)
Edited by Klexen
Link to comment
Share on other sites

See the index parameter of the _IEGetObjByName function.

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

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