minaset Posted July 30, 2012 Share Posted July 30, 2012 Hi . I dont know english so well or i just dont understand how to make my browser in GUI to select option from IE combobox. [/size][/font][/color] [color=#000000][font=Consolas, 'Lucida Console', monospace][size=3]<form method="post" action="javascript:void(0)" onsubmit="bar.makeTegevus(get('tegevus').value);"> <select id="tegevus" name="tegevus" class="kast"> <option value="-1">Millega tegeled ?</option> <option value="10">Õpin</option> <option value="20">Töötan</option> <option value="30">Muu</option>I have tried this , but its not working...[/size][/font][/color] $oForm = _IEFormGetObjByName($browser, 0) $oSelect = _IEFormElementGetObjByName($oForm, "tegevus") ;_IEFormElementOptionSelect($oSelect, "10", 1, "byValue") _IEFormElementOptionSelect($oSelect, "Õpin", 0, "byText") _IEAction($oButton, "click") [color=#000000][font=Consolas, 'Lucida Console', monospace][size=3]Thanks in advance Link to comment Share on other sites More sharing options...
water Posted July 30, 2012 Share Posted July 30, 2012 IIRC if you embed the IE into a GUI it is done with an ActiveX control. This doesn't act like the real IE. Could you try your script without embedding IE into the GUI? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
minaset Posted July 30, 2012 Author Share Posted July 30, 2012 I dont actually know how to use it outside of the GUI . Anyway i still would like to use GUI and i know that its wrong topic but maybe you can help me with which functions should i search for to get answer ? Link to comment Share on other sites More sharing options...
water Posted July 30, 2012 Share Posted July 30, 2012 You use function _IECreateEmbedded now to create the IE control in your GUI. Replace this with _IECreate and see if your script works now. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
minaset Posted July 30, 2012 Author Share Posted July 30, 2012 i still didnt get it to work . it just dont choose the option and continues with other commands. Link to comment Share on other sites More sharing options...
water Posted July 30, 2012 Share Posted July 30, 2012 Can you post the code you have so far? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
minaset Posted July 31, 2012 Author Share Posted July 31, 2012 Sry , but i dont want to publish my webpage . #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister()Local $oIE = _IECreate("www.mywebsite.ee/?id=andmed", 1, 1, 0) $oLink = _IEGetObjById($oIE, "valge") _IEAction($oLink, "click") Sleep(300) $oForm = _IEFormGetCollection($oIE, 0) $oQuery1 = _IEFormElementGetObjByName ($oForm, "firstname") $oQuery2 = _IEFormElementGetObjByName ($oForm, "lastname") _IEFormElementSetValue($oQuery1, "minu") Sleep(300) _IEFormElementSetValue($oQuery2, "nimi") Sleep(300) Send("{ENTER}") Sleep(2000) _IENavigate($oIE, "http://www.mywebsite.ee/?id=andmed#ankeet") Sleep(800) local $oButton2, $oButton $oForm2 = _IEFormGetObjByName($oIE, 0) $oSelect = _IEFormElementGetObjByName($oForm2, "tegevus") ;_IEFormElementOptionSelect($oSelect, "10", 1, "byValue") _IEFormElementOptionSelect($oSelect, "Õpin", 0, "byText") _IEAction($oButton2, "click") $oButton = _IEGetObjById ($oIE, "saada_ankeet") _IEAction($oButton, "click") Sleep(500) Link to comment Share on other sites More sharing options...
water Posted July 31, 2012 Share Posted July 31, 2012 If you run your script from SciTE what error messages do you get? To do some debugging you could insert the following line after each _IE* function call:ConsoleWrite(@error & @CRLF)So you can see which statements fail. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
minaset Posted July 31, 2012 Author Share Posted July 31, 2012 It show these errors : --> IE.au3 V2.4-0 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch 7 --> IE.au3 V2.4-0 Error from function _IEFormElementOptionSelect, $_IEStatus_InvalidDataType 3 --> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType 3 Link to comment Share on other sites More sharing options...
water Posted August 1, 2012 Share Posted August 1, 2012 So one of the _IEFormElementGetObjByName calls doesn't find the specified object.BTW: If I interpret your correctly you try to automate the login to a website. Is this correct? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
ReFran Posted August 1, 2012 Share Posted August 1, 2012 Hi,in js/html you can choose an option via selectedIndex. So in autoit you can use something like:$index = 0 ;=first element$oIe.document.all.tegevus.selectedIndex = $indexHTH, Reinhard Link to comment Share on other sites More sharing options...
minaset Posted August 1, 2012 Author Share Posted August 1, 2012 I wouldn't say that it is login . I just try to make something for my web. If i log in to my computer i open autoit script and then its sends my name and "tegevus" which means whats my position. ReFran , i got by selectedIndex. Thanks alot to both of you 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