CemalSenturk Posted January 6, 2015 Share Posted January 6, 2015 Here as you can see. Where is the problem? I can't find it.. After I click ''Go'' on AutoIt 3. Opens webpage and nothing happens. Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2015 Share Posted January 6, 2015 (edited) Next time, please post the actual code rather than a screenshot. There isn't a object with a name of "submit", so that's the first issue. Not positive, but the second issue appears to be due to your use of _IEGetObjByName instead of _IEFormElementGetObjByName. Try using _IEFormGetCollection along with _IEFormElementGetObjByName and let us know how that works for you. P.S. Welcome to the forums! Edited January 6, 2015 by Danp2 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 6, 2015 Author Share Posted January 6, 2015 Next time, please post the actual code rather than a screenshot. There isn't a object with a name of "submit", so that's the first issue. Not positive, but the second issue appears to be due to your use of _IEGetObjByName instead of _IEFormElementGetObjByName. Try using _IEFormGetCollection along with _IEFormElementGetObjByName and let us know how that works for you. P.S. Welcome to the forums! How I can exactly do that can you please help me ? #include <IE.au3> Call ("SignIn") Func SignIn () Global $oIE = _IECreate ("http://www.car.gr/users/login") Local $username = _IEFormElementGetObjByName ($oIE,"ql_user") Local $password = _IEFormElementGetObjByName ($oIE,"ql_pass") Local $button = _IEGetObjByName ($oIE,"submit") _IEFormElementSetValue ($username,"5121406") _IEFormElementSetValue ($password,"...") _IEAction ($button, "click") EndFunc Here is my code right now. And what is wrong with submit button ? It says type=submit but why there isnt name=? Sorry for bad english Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 6, 2015 Author Share Posted January 6, 2015 #include <IE.au3> Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/users/login") $oForm = _IEFormGetCollection ( ByRef $o_object [, $i_index = -1] ) $oText = _IEFormElementGetObjByName($oForm, "username") _IEFormElementSetValue($oText, "demo") $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "demo") _IEFormSubmit($oForm) I did something like this but not works Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2015 Share Posted January 6, 2015 $oForm = _IEFormGetCollection ($oIE, 0) ; retrieves first form Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 6, 2015 Author Share Posted January 6, 2015 $oForm = _IEFormGetCollection ($oIE, 0) ; retrieves first form #include <IE.au3> Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/users/login") $oForm = _IEFormGetCollection ($oIE, 0) $oText = _IEFormElementGetObjByName($oForm, "username") _IEFormElementSetValue($oText, "demo") $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "demo") _IEFormSubmit($oForm) and here is the errors. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3" --> IE.au3 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidObjectType --> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidObjectType --> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 Error from function _IEFormSubmit, $_IEStatus_InvalidObjectType >Exit code: 0 Time: 11 Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2015 Share Posted January 6, 2015 There are two forms on this page. Turns out that you need the second one: #include <IE.au3> Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/users/login") $oForm = _IEFormGetCollection ($oIE, 1) $oText = _IEFormElementGetObjByName($oForm, "username") _IEFormElementSetValue($oText, "demo") $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "demo") _IEFormSubmit($oForm) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 6, 2015 Author Share Posted January 6, 2015 There are two forms on this page. Turns out that you need the second one: #include <IE.au3> Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/users/login") $oForm = _IEFormGetCollection ($oIE, 1) $oText = _IEFormElementGetObjByName($oForm, "username") _IEFormElementSetValue($oText, "demo") $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "demo") _IEFormSubmit($oForm) Just tried them and error.. Can you please do a program that writes ''demo'' in the boxes on http://www.car.gr/users/login and share the code ? Thank you so much btw. Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2015 Share Posted January 6, 2015 That's what the code I just posted does. It worked fine for me, so I don't know why it didn't for you. If you want further help, then post the output from the Scite window so that we can see what the actual errors are. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 6, 2015 Author Share Posted January 6, 2015 (edited) Using last code you posted and here is errors.. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3" --> IE.au3 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidObjectType --> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidObjectType --> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 Error from function _IEFormSubmit, $_IEStatus_InvalidObjectType >Exit code: 0 Time: 2.198 Edited January 6, 2015 by CemalSenturk Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 6, 2015 Author Share Posted January 6, 2015 I changed the IE.au3 file and now it works perfectly! Thank you so much Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2015 Share Posted January 6, 2015 You may want to research kb3025390 (a recent update from MS). If you have this installed, it may be the cause of the script not working. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2015 Share Posted January 6, 2015 For the benefit of others, can you explain what you changed to make it work? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 7, 2015 Author Share Posted January 7, 2015 (edited) I downloaded the IE.au3 from this topic and it worked '?do=embed' frameborder='0' data-embedContent>> And I have another problem My code is here: #include <IE.au3> Call ("SignIn") Func SignIn() Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/users/login") $oForm = _IEFormGetCollection ($oIE, 1) $oText = _IEFormElementGetObjByName($oForm, "username") _IEFormElementSetValue($oText, "...") $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "...") _IEFormSubmit($oForm) _IENavigate($oIE, "http://www.car.gr/classifieds/tractors/edit/5121406/#details") EndFunc And I want to click a button but _IEFormSubmit($oForm) didnt work. Source is like this. <div class="form-actions"> <button class="btn btn-primary" type="submit">Name of Button</button> </div> Edit : After that I need to kill the Internet Explorer by automatically for calling another function. How to do that? Edited January 7, 2015 by CemalSenturk Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2015 Share Posted January 7, 2015 1) You should never post your login name and password on the open forum! 2) I don't understand. Are you saying that you want to click another button that is on the new page after the _IENavigate? 3) Look at _IEQuit in the help file Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 7, 2015 Author Share Posted January 7, 2015 1) You should never post your login name and password on the open forum! 2) I don't understand. Are you saying that you want to click another button that is on the new page after the _IENavigate? 3) Look at _IEQuit in the help file 1) Sorry I forget to change 2) Yes exactly that Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2015 Share Posted January 7, 2015 And I want to click a button but _IEFormSubmit($oForm) didnt work.Source is like this. <div class="form-actions"> <button class="btn btn-primary" type="submit">Name of Button</button> </div> I can't find anything resembling this html on the webpage that your prior code referenced. You will need to provide more details. Exactly which button are you attempting to click? Post your code that shows what you have tried thus far. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 7, 2015 Author Share Posted January 7, 2015 (edited) Source is like I posted. There is no button id or button name. Here you can see all the details tab (navigated new page) <div class="tab-pane active" id="details"> <h2>Στοιχεία></h2> <p>...</p> <p>...</p> <form class="form-horizontal" action="/classifieds/tractors/edit/5121406/#details" method="post"> <input name="dealer_id" type="hidden" value=""></input> <fieldset>...</fieldset> <fieldset>...</fieldset> <fieldset>...</fieldset> <fieldset>...</fieldset> <fieldset>...</fieldset> <fieldset>...</fieldset> <fieldset>...</fieldset> <fieldset>...</fieldset> <p class="alert alert-warning"</p> <fieldset>...</fieldset> <div class="form-actions"> <button class="btn btn-primary" type="submit">Σώσε αλλαγές</button> </div> </form> </div> I have tried so far this code $oFound = "" Local $oBtns = _IETagNameGetCollection($oIE, "button") For $oBtn In $oBtns If String($oBtn.classname) = "btn btn-primary" Then $oFound = $oBtn EndIf Next If IsObj($oFound) Then _IEAction ($oFound, "click") MsgBox(16, "Success", "Password23 with a captial P (Roles have been set)") Else MsgBox(16, "Failed", "Not found.") EndIf and this one. but no one is working $oButtons = _IETagNameGetCollection ($oIE, "div") ; not sure about input For $oButton In $oButtons If $oButton.class = "btn btn-primary" Then _IEAction ($oButton, "click") ExitLoop EndIf Next My Operating System is : Windows 7 x64 Ultimate SP1 My IE version is : last updated 11.0.9600.17358 Edited January 7, 2015 by CemalSenturk Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2015 Share Posted January 7, 2015 (edited) There are multiple forms on the webpage. You could try something like this: Local $oForms = _IEFormGetCollection($oIE) For $oForm In $oForms If $oForm.Action = '/classifieds/tractors/edit/5121406/#details' Then _IEFormSubmit($oForm) ExitLoop Next Edit: The following appears to get a direct reference to the form without the looping -- Local $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) Edited January 7, 2015 by Danp2 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2015 Moderators Share Posted January 7, 2015 CemalSenturk,We do not permit multiple accounts. Please stick to your existing account - I have deleted the CemalSenturk1 account you just created. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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