Jump to content

UDF, wrong data type


Recommended Posts

Hi, ive been recently learning the UDF commands with _IE, i have read through the tutorials and am starting to understand them alot, however for this perticular project i cant understand why my code is not working

Here is an example of the scrip im using

#include <IE.au3>
$oIE = _IECreate()
_IENavigate($oIE, "[url="http://172.30.238.40/CAisd/pdmweb.exe"]http://172.30.238.40/CAisd/pdmweb.exe[/url]")
$oForm = _IEFormGetObjByName($oIE, "login")
$oQuery = _IEFormElementGetObjByName($oForm, "USERNAME")
$oQuery2 = _IEFormElementGetObjByName($oForm, "PIN")
_IEFormElementSetValue($oQuery, "place your search string here")
_IEFormElementSetValue($oQuery2, "place your search string here")
_IEFormSubmit($oForm)
_IELoadWait($oIE)
Exit

However when i use the script it opens up the page but i then get the following error message

--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> 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 _IEFormSubmit, $_IEStatus_InvalidDataType

Here is an example of the webpages elements

Form

<form name="login" action="/CAisd/pdmweb.exe" method="post">

Username box

<input name="USERNAME" class="focusField" id="USERNAME" onfocus="this.className='focusField';" onblur="this.className='';" type="text" size="20"/>

Password box

<input name="PIN" id="PIN" onfocus="this.className='focusField';" onblur="this.className='';" type="password" size="20"/>

What does it mean by invaliddatatype, this has worked for every other form ive tryed (google,yahoo,other login pages ect)

Thanks.

Ant.

Edited by Annonyreeder
Link to comment
Share on other sites

After each call of an IE* function I would check for errors. So you can be sure that the next function relying on the result of a previous function works as expected.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Looks like the name of the form isn't "login".

I suggest you check the source code of the page.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

i think i might of worked this out, the inputnames/ (login boxs) seem to be inside of this code

"<table id="tbl001" cellSpacing="10">"

Could i have to get th eTable ID instead of the form name? or do i have to get the form name and then the table ID within the form and then the input name of the login box? and if so how would i go about doing that? please n thank you :)

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