Moderators Melba23 Posted January 7, 2015 Moderators Share Posted January 7, 2015 CemalSenturk,I have also deleted your second attempt at a CemalSenturk1 account - if you create a third new account you will be permanently removed from the community. 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...
CemalSenturk Posted January 7, 2015 Author Share Posted January 7, 2015 CemalSenturk, I have also deleted your second attempt at a CemalSenturk1 account - if you create a third new account you will be permanently removed from the community. M23 Sorry for breaking the rules.. I will be more careful next time 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) And here I tried both of the codes you wrote but nothing happened.. Also I tried this but nothing happens.. Local $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) _IEAction ($oForm, "click") ;tried with " _IEAction ($oDiv, "click") " but no :( Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2015 Share Posted January 7, 2015 You need to think this through. Once you have a reference to the form, what is it that you are trying to do? Click on it (the form)? No, I don't think so. Did you try: Local $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) _IEFormSubmit($oForm) 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 You need to think this through. Once you have a reference to the form, what is it that you are trying to do? Click on it (the form)? No, I don't think so. Did you try: Local $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) _IEFormSubmit($oForm) Thank you so much! This code works! Have a good day man you are awesome Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 7, 2015 Author Share Posted January 7, 2015 (edited) Yeah.. worked for twice but now causing error.. #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, "---") sleep(500) _IEFormSubmit($oForm) sleep(1000) _IENavigate($oIE, "http://www.car.gr/classifieds/tractors/edit/5121406/#details") Local $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) _IEFormSubmit($oForm) sleep(2000) ProcessClose("iexplore.exe") EndFunc and here is errors >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3" --> IE.au3 T3.0-0 Error from function _IENavigate, $_IEStatus_COMError (-2147352567) --> IE.au3 T3.0-0 Warning from function _IEGetObjById, $_IEStatus_NoMatch (details) --> IE.au3 T3.0-0 Error from function _IETagNameGetCollection, $_IEStatus_InvalidDataType --> IE.au3 T3.0-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType >Exit code: 0 Time: 5.299 Previously to switch tabs* I used _IENavigate. Maybe there is the problem?? 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 What OS? Autoit version? IE version? 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 OS: Windows 7 64-Bit Ultimate AutoIt Version 3.4.1 IE Version 11.0.9600.17358 Now I use sleep only between _IEFormElementSetValue($oText, "my pass here") and submit button and runs nicely without error until this code comes. Local $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) _IEFormSubmit($oForm) Sometimes works but sometimes causes error. Can we use mouse to scroll down and click the button's x,y coordinates ? Link to comment Share on other sites More sharing options...
Danp2 Posted January 8, 2015 Share Posted January 8, 2015 FWIW, 3.4.1 sounds like your Scite version. You are probably using 3.3.12.0 or later. I suspect that this issue is caused by the IE object being destroyed whenever you navigate to a new page. Try the following: expandcollapse popup#include <IE.au3> SignIn() DoStuff() SignOut() 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) EndFunc Func DoStuff() Local $oIE, $oDiv, $oForm $oIE = _IEAttach("5121406") If IsObj($oIE) Then _IENavigate($oIE, "http://www.car.gr/classifieds/tractors/edit/5121406/#details") $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) _IEFormSubmit($oForm) EndIf EndFunc Func SignOut() Local $oIE = _IEAttach("5121406") If IsObj($oIE) Then _IEQuit($oIE) EndIf EndFunc Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 8, 2015 Author Share Posted January 8, 2015 AutoIt Version : v3.3.12.0 Navigate didn't worked. I'm still on default page. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3" --> IE.au3 T3.0-0 Warning from function _IEAttach, $_IEStatus_NoMatch --> IE.au3 T3.0-0 Warning from function _IEAttach, $_IEStatus_NoMatch >Exit code: 0 Time: 1.999 Link to comment Share on other sites More sharing options...
Danp2 Posted January 8, 2015 Share Posted January 8, 2015 Ok... so both attempts of _IEAttach failed. Now you need to figure out why. FWIW, it worked when I ran it. <shrug> Read how _IEAttach works and adjust the statement until it works. You could try this: $oIE = _IEAttach("car.gr", "url") instead of this: $oIE = _IEAttach("5121406") Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 8, 2015 Author Share Posted January 8, 2015 (edited) $oIE = _IEAttach("car.gr", "url") Yes that worked I'm in the navigated page but no button clicks Errors.. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3" --> IE.au3 T3.0-0 Warning from function _IELoadWait, $_IEStatus_LoadWaitTimeout --> IE.au3 T3.0-0 Error from function _IEGetObById, $_IEStatus_InvalidObjectType --> IE.au3 T3.0-0 Error from function _IETagNameGetCollection, $_IEStatus_InvalidDataType --> IE.au3 T3.0-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType --> IE.au3 T3.0-0 Warning from function _IEAttach, $_IEStatus_NoMatch >Exit code: 0 Time: 302.8 There isn't errors while running normally, but I have issues about my internet connection because of that here is error. Edited January 8, 2015 by CemalSenturk Link to comment Share on other sites More sharing options...
Danp2 Posted January 8, 2015 Share Posted January 8, 2015 Sorry, but I'm out of ideas. The script as provided runs fine for me. You will need to troubleshoot on your end to figure out why it isn't working there. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 8, 2015 Author Share Posted January 8, 2015 (edited) And lol I just deleted advertisement by mistake changing the IECreate url My Idea was to create #details page directly. Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/classifieds/tractors/edit/4883230/#details") $oForm = _IEFormGetCollection ($oIE, 1) $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "---") _IEFormSubmit($oForm) Write the password and no need for navigate command. Now just need to figure out how to click that button without deleting the advertisement Edited January 8, 2015 by CemalSenturk Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 8, 2015 Author Share Posted January 8, 2015 Here I made an advertisement for testing. username is 5927923 and password 123456 http://www.car.gr/classifieds/cars/edit/5927923/?first#details join from here and write a script for clicking the button "Save Changes" PLEASE . Thank you so much! Link to comment Share on other sites More sharing options...
Danp2 Posted January 8, 2015 Share Posted January 8, 2015 Cernal, This forum isn't designed for you to outsource the development of your script. We are here to offer assistance, and I feel that I have already given you all of the necessary code to accomplish your described task. At this point, you need to write the complete script and then run it. If it doesn't work, then show us the code and give specific details to describe where it is failing. Hint: you probably should add some debugging code (see either ConsoleWrite or see the option Add Trace Lines under the Scite Tools menu) so that it will be easier for others to assist with debugging the code. Dan Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 8, 2015 Author Share Posted January 8, 2015 (edited) This code instead of clicking Save Button, affects Delete button. #include <IE.au3> SignIn() DoStuff() SignOut() Func SignIn() Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/classifieds/tractors/edit/5927920/#details") $oForm = _IEFormGetCollection ($oIE, 1) $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "---") _IEFormSubmit($oForm) EndFunc Func DoStuff() Local $oIE, $oDiv, $oForm If IsObj($oIE) Then $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 0) _IEFormSubmit($oForm) EndIf EndFunc Func SignOut() If IsObj($oIE) Then _IEQuit($oIE) EndIf EndFunc Here is the save and delete button's sources: expandcollapse popup<div class="tab-content"> <div class="tab-pane active" id="delete"> <h2>Delete</h2> <form id="delete_form" action="/classifieds/tractors/delete/5929826/" method="post"> <input type="checkbox"> <button type="submit" class="btn btn-danger" disabled="disabled"> <i class="fa fa-trash-o"> ::before</i> </button> </form> </div> <div class="tab-pane" id="photos">...</div> <div class="tab-pane active" id="details"> <h2>Details></h2> <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">Save Changes</button> </div> </form> </div> <div class="tab-pane" id="statistics">...</div> <div class="tab-pane" id="reports">...</div> <div class="tab-pane" id="trading">...</div> <div class="tab-pane" id="preview">...</div> </div> Any Ideas how to click Save Button without clicking Delete button? Edited January 8, 2015 by CemalSenturk Link to comment Share on other sites More sharing options...
Danp2 Posted January 8, 2015 Share Posted January 8, 2015 There are multiple forms show, so my guess is that $oForm is pointing to the wrong one. I'll leave it to you to figure out how to reference the correct form. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 9, 2015 Author Share Posted January 9, 2015 I tried: $oForm = _IETagNameGetCollection($oDiv, "form", 0) $oForm = _IETagNameGetCollection($oDiv, "form", 1) $oForm = _IETagNameGetCollection($oDiv, "form", 2) But no.. Link to comment Share on other sites More sharing options...
Danp2 Posted January 9, 2015 Share Posted January 9, 2015 Your version of DoStuff will never run the code inside the If...Endif because you took out the _IEAttach. Go back and look at the DoStuff function that I originally posted. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CemalSenturk Posted January 9, 2015 Author Share Posted January 9, 2015 expandcollapse popup#include <IE.au3> SignIn() DoStuff() SignOut() Func SignIn() Local $oIE, $oForm, $oText $oIE = _IECreate ("http://www.car.gr/classifieds/tractors/edit/5934173/#details") $oForm = _IEFormGetCollection ($oIE, 1) $oText = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oText, "---") _IEFormSubmit($oForm) EndFunc Func DoStuff() Local $oIE, $oDiv, $oForm $oIE = _IEAttach("5934173") If IsObj($oIE) Then _IENavigate($oIE, "http://www.car.gr/classifieds/tractors/edit/5934173/#details") $oDiv = _IEGetObjById($oIE, "details") $oForm = _IETagNameGetCollection($oDiv, "form", 2) _IEFormSubmit($oForm) EndIf EndFunc Func SignOut() Local $oIE = _IEAttach("5934173") If IsObj($oIE) Then _IEQuit($oIE) EndIf EndFunc code is here and tried with form 0,1,2 keeps deleting.. 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