Sign in to follow this  
Followers 0
Annonyreeder

UDF, wrong data type

7 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks, but that isnt the problem, i can see its not seeing the form

'Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch'

But i just don't know why? it works for everything else :S

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

I don't believe the issue is with the tables. Take a look at _IEFormGetCollection in the Help file and some of the examples there.

Share this post


Link to post
Share on other sites

_IELoadWait after the navigation is always helpfull too. (even though the _IENavigate states it waits)


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
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
Sign in to follow this  
Followers 0