CaptainBeardsEyesBeard Posted August 25, 2020 Share Posted August 25, 2020 Hi I am trying to set the form element for this html <input name="ctl00$MPH$pnlOutstandingPayments$ctlPaymentFileListing$ctl28" class="VerySmallFormEntry" style="width: 173px;" type="text"> by using the below ( i am trying 2 method first by _IEFormElementSetValue then by using a For Loop to loop through the Inputs ;Select Accounts matching $AccountsID = _IEFormElementGetObjByName($oIE, "ctl00$MPH$pnlOutstandingPayments$ctlPaymentFileListing$ctl28") _IEFormElementSetValue($AccountsID, "TEST1") If @error Then ConsoleWrite(@CRLF & "Can't set value") EndIf Local $Divs = _IETagNameGetCollection($oIE, "input") For $Div In $Divs ;~ Check if Button InnerText equals Log In and perform an action. ;~ Uncomment the _IEAction line below to submit the form. If $Div.innerText = "TEST1" Then if @Error then ConsoleWrite(@CRLF & "Error finding submit button") Endif MsgBox(64, 'A TEST1 account found', 'Div found with value: ' & $Div.InnerText, 2) ExitLoop Sleep(4000) EndIf Next However I get the console write of the first error but it doesn't do anything on the For loop (it doesn't hit the IF @error Link to comment Share on other sites More sharing options...
Danp2 Posted August 25, 2020 Share Posted August 25, 2020 It might help if you showed us the full console output. Also, your second method doesn't make sense to me. You are checking @error, but it isn't clear which command would have set the value. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted August 25, 2020 Author Share Posted August 25, 2020 There's not much in the console output Loading URL --> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType Can't set value>Exit code: 0 Time: 24.44 Link to comment Share on other sites More sharing options...
Danp2 Posted August 25, 2020 Share Posted August 25, 2020 Well.... it's enough to explain why the first method didn't work. Did you try _IEGetObjByName instead? Have you checked to see if the site uses frames? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheXman Posted August 25, 2020 Share Posted August 25, 2020 (edited) 3 hours ago, CaptainBeardsEyesBeard said: $AccountsID = _IEFormElementGetObjByName($oIE, "ctl00$MPH$pnlOutstandingPayments$ctlPaymentFileListing$ctl28") _IEFormElementSetValue($AccountsID, "TEST1") If @error Then ConsoleWrite(@CRLF & "Can't set value") EndIf @CaptainBeardsEyesBeard Could your problem be that the first parameter of the _IEFormElementGetObjByName() function should be the form object, not the IE application object? Look at the help file's example for the _IEFormElementGetObjByName() function. Notice how they get the form object, using _IEFormGetObjByName(), right before they use it in the _IEFormElementGetObjByName() function in the next line? Edited August 25, 2020 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman 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