Jump to content

Recommended Posts

Posted

Hi guys, I'm new to autoit, but so far I love using it and have been having a blast working on test automation with it.

However, I've hit a snag, in that I need to select an option from a select that displays on a page, but the select for whatever reason is not located within a form.

At first I assumed this was wrong, but after double checking with _IEFormGetCollection, none of the forms

contained the select I need to access.

So my question is, how do I select this option, so that I might move on with my script, when the select is not part of a form. I've tried using _IE action, and I've had little success so far.

Thank you,

Athos

Posted (edited)

for the sake of protecting the information on the page i'm going to change a few names:

<span class="smpGroupItemLabel">Selectotheright:</span> <SELECT ID='X' NAME='X' onchange="javascript:setSimpleGroupRuleOption('CO', 'C_D', this.options[this.selectedIndex].value,'D')" ><option id="This is the option that I want" value="All">All</option>

Edited by Athos
Posted

You should be able to use something like:

$oIE = _IECreate("http://somesite.com")
$oSelect = _IEGetObjByName($oIE, "X")

_IEFormElementOptionSelect($oSelect, "All", 1, "byText")
; or
_IEFormElementOptionSelect($oSelect, "This is the option that I want")

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
×
×
  • Create New...