Jump to content

IEObjByName retreival error - warning from function


Recommended Posts

Hi

I'm having some trouble with an auto login code I'm trying to write, and would like some help :)

Having read the rules, and looking at other threads, I apologise now if this is against the rules, but I don't think it is...

What I'm trying to do...

Create GUI to enter details (user, pass) and save to file.

Create code to open webpage and send details.

Navigate to specific page.

Save a .pdf file from drop down menu to PC

This is the code I have (I appreciate it is not pretty):

#include 

$W = "http://webpage"
$oIE = _IECreate($W, 0, 1, 1, 1)
_IELoadWait ($oIE)


Local $username =_IEGetObjByName ($oIE, "input#ct100$PageBody$userName")
Local $password =_IEGetObjByName ($oIE, "ct100$PageBody$password")
Local $pin = _IEGetObjByName($oIE, "ct100$PageBody$PIN")

_IEFormElementSetValue ($username, "User")
_IEFormElementSetValue ($password, "Pass")
_IEFormElementSetValue ($pin, "Pin")

The biggest part I am having trouble with is send the details to the webpage. It is a .aspx site and I receive the error message:

--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: input#ct100$PageBody$userName, Index: 0)

--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: ct100$PageBody$password, Index: 0)

--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: ct100$PageBody$PIN, Index: 0)

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

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

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

>Exit code: 0 Time: 11.325

Does anyone have any ideas how to get the details sent to the webpage??

Thanks in advance!! :)

Link to comment
Share on other sites

This is part of the HTML I'm trying to reach...

<fieldset>

<div id="ctl00_PageBody_ValidationSummary1" class="warning" style="color:Red;display:none;">

</div>

<label for="userName">

User Name:

</label>

<input name="ctl00$PageBody$userName" type="text" id="ctl00_PageBody_userName" class="small" onclick="return userName_onclick()">

<span id="ctl00_PageBody_reqUN" style="color:Red;visibility:hidden;">*</span>

<br>

<br>

<label for="password">

Password:</label>

<input name="ctl00$PageBody$password" type="password" id="ctl00_PageBody_password" class="small">

<span id="ctl00_PageBody_reqPW" style="color:Red;visibility:hidden;">*</span>

<br>

<br>

<label for="PIN">

PIN:</label>

<input name="ctl00$PageBody$PIN" type="Password" id="ctl00_PageBody_PIN" class="pin">

<span id="ctl00_PageBody_CustomValidatorPIN" style="color:Red;visibility:hidden;"></span>

<!-- <span id="ctl00_PageBody_RequiredFieldValidator1" style="color:Red;visibility:hidden;">*</span> -->

<br>

<br>

<div class="divLogin">

<input type="submit" name="ctl00$PageBody$btnLogin" value="Login" onclick="showLoadingIcon();WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$PageBody$btnLogin&quot;, &quot;&quot;, true, &quot;ValidationSummary1&quot;, &quot;&quot;, false, false))" id="ctl00_PageBody_btnLogin" class="button">

<input type="submit" name="ctl00$PageBody$btnForgotPassword" value="Forgot Password?" id="ctl00_PageBody_btnForgotPassword" class="button">

<div id="myDiv" style="display: none">

<img src="../Images/Login-loader.gif" alt="Loading...">

</div>

<br>

</div>

<br>

<br>

By using this website (through any device) you are agreeing we can set and use cookies.

<br>

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