Jump to content

Recommended Posts

Posted

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

Posted

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

 

Posted

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 ?

Posted

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

 

Posted

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

 

Posted

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)
Posted

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

 

Posted

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
Posted

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

 

Posted

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 = $index

HTH, Reinhard

Posted

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 :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...