Annonyreeder Posted April 23, 2013 Share Posted April 23, 2013 (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 April 23, 2013 by Annonyreeder Link to comment Share on other sites More sharing options...
water Posted April 23, 2013 Share Posted April 23, 2013 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 - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Annonyreeder Posted April 23, 2013 Author Share Posted April 23, 2013 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 Link to comment Share on other sites More sharing options...
water Posted April 23, 2013 Share Posted April 23, 2013 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 - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Annonyreeder Posted April 23, 2013 Author Share Posted April 23, 2013 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 More sharing options...
Danp2 Posted April 23, 2013 Share Posted April 23, 2013 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. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
jdelaney Posted April 23, 2013 Share Posted April 23, 2013 _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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now