Jump to content

_IEFormElementOptionSelect()


 Share

Recommended Posts

Hello.

I use AutoIt 3.3.8.1 to create some Automated Test Cases for a Application.

After a long research I've still a problem with the _IEFormElementOptionselect() function with IE 9 (in Standard mode).

I will select in a ComboBox on value from that options:

<div style="width: 33%;" class="groupingtext">
  <div style="position: relative;" id="SalutationCombobox"><input aria-haspopup="true" style="cursor: pointer;" id="SalutationInput" class="ui-autocomplete-input ui-widget ui-widget-content ui-corner-all unselectable ui-state-highlight" role="textbox" tabIndex="-1" name="SalutationInput" readOnly="" value="" autocomplete="off" aria-autocomplete="list" unselectable="on"><button aria-disabled="false" class="ui-button ui-widget ui-state-default ui-button-icon-only ui-corner-right ui-autocomplete-button" role="button" type="button"><span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></span><span class="ui-button-text">&nbsp;</span></button>
  <select style="width: 100%; display: none;" id="Salutation" class="ui-widget-content ui-corner-all" name="Salutation">
        <option></option>
        <option value="Frau">Frau</option>
        <option value="Herr">Herr</option>
       </select></div>
      </div>

with that AutoIt Code:

$oIE = _IECreate($oSiteLogonAddress)
$oForm = _IEGetObjById($oIE, "ctl01")
$oSalutation = _IEFormElementGetObjByName($oForm, "Salutation")
_IEFormElementOptionSelect($oSalutation, "Herr", 1, "byValue")
$oIE.document.getElementById("CustomerSave").click

The Problem is that the value will not set in the Combobox because of that I get also an error by the Validation functions.

To Change to IE9 to the "Compatibility Mode" is not a solution for me because I have to test the application in Standard-Mode.

Also I had Check the AutoIt Bugtracker but there is no Entry about that Bug.

Edited by mima1974
Link to comment
Share on other sites

Try the examples for that function in the helpfile. If they work, you have an issue specific to your webpage and you'll need to dig further into it to see what makes it unique (some Javascript bound to the element, perhaps).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Hello Dale,

thank you for your Answer I will try it.

I've found the '_IEFormElementOptionselect.au3' Example in the "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\" directory.

Now (and Sorry) I'm searching for the 'form example' that is mentioned in the comment lines of the _IEFormElementOptionselect.au3 sample file!

; *******************************************************
; Example 1 - Open a browser with the form example, get reference to form, get reference
;    to select element, cycle 10 times selecting options byValue, byText and byIndex
;    Note: You will likely need to scroll down on the page to see the changes
; *******************************************************

Where is the form example placed?

Link to comment
Share on other sites

Hello Dale,

I was run the example successful. Now I've google for "_IEFormElementOptionselect bound to the element" but get no further information's about what the problem can be.

Did you (or other persons) have any tips to find a solution for my problem?

Greetings

Link to comment
Share on other sites

You missed the word "Javascript". You'll need to examine and learn about the source code of your HTML page... try a DOM Inspector (like DebugBar... see my sig). Or... you must post a reproducer.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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