Jump to content

No error finding _ieformelement in console but won't set value


Go to solution Solved by DW1,

Recommended Posts

I am able to find this element

<input name="NO" onkeyup="this.value = this.value.toUpperCase();" onkeypress="IsEngorInt(event)" type="text" size="20" maxlength="12" value=""/>

From my Code below. There's no error finding the $input or formname either. I made sure my $masterbill is pulling ok too, with the msgbox. Has anyone ran into any issues like this? Thanks! Also curious how everyone pastes their code on the message boards where it can be scrolled through. I've just been pasting the text.

#include <IE.au3>

#include <Excel.au3>

#include <Array.au3>

$row = 3

$value = InputBox("Steam Vessel Tracking Script", " ENTER ACTION TO PERFORM"&@lf&@LF&"1. Track Shipments"&@lf&"2. Input CFIT Information"&@lf&"3. "&@lf&"4. "&@lf&" ", "*", " M1")

If @error = 1 Then Exit; Cancel button pressed

$oExcel = _ExcelBookOpen("F:EIDFWNATOracle NMCNMC DevelopmentNetwork AnalystReportsautoitSteam Trac Tool.xlsx")

$aArray = _ExcelReadSheetToArray($oExcel)

$counter = $aArray[0][0]

$oIE = _IECreate("http://www.shipmentlink.com/servlet/TDB1_CargoTracking.do",0,1,1)

If $value = 1 Then

Do

$masterbill = $aArray[$row][1]

$oForm = _IEFormGetObjByName($oIE, "frmCargo");enter the form id or name

$input = _IEFormElementGetObjByName($oForm, "NO")

MsgBox("", "", $masterbill)

_IEFormElementSetValue($input, $masterbill)

#include <IE.au3>

$oButtons = _IETagNameGetCollection($oIE, "INPUT")

For $oButton In $oButtons

If String($oButton.type) = "button" Then

; Save the current element to a variable

$oButton2Save = $oButton

; Exit the for loop now that we have found the go button

ExitLoop

EndIf

Next

_IEAction($oButton2Save, "click")

_IELoadWait($oie)

$row = $row + 1

_IENavigate($oIE, "http://www.shipmentlink.com/servlet/TDB1_CargoTracking.do",1)

_IELoadWait($oie)

Until $row = $counter + 1

MsgBox("","Information Gathered", "All Shipments Tracked")

EndIf

Edited by dar100111
Link to comment
Share on other sites

  • Solution

Looking at the page source there are five (name="NO") before the one you wanted (instances 0-4)

<input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();">&nbsp;
<input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();">&nbsp;
<input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();">&nbsp;
<input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();">&nbsp;
<input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();">&nbsp;&nbsp;
Edited by danwilli
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...