I am trying to select option from the select2 dropDown list but i am not able to do so This is the code
enter code here
<select id="addedLanguageId" class="input-large select2-me
select2-offscreen" name="language.id" style="width: 200px;"
tabindex="-1"> <option value="">Select a language</option> <option
value="1">Aboriginal Dialects</option> <option
value="2">Afrikaans</option> <option value="3">Ainu</option> <option
value="4">Akkadian</option> <option value="5">Albanian</option>
</select>`
I have tried so many things like $("form").language.id=["4"]
or added code in page like selectLang{$('#language.id')}
and in test like selectLang.value('20')
. I used other concepts like selectLang{$('#language.id')}
and
dropdownSelectedText {selectLang.find('option', value:selectLang.value()).text()}
in page and done testing with:
when:
selectLang='Akkadian'
then:
dropdownSelectedText=='Akkadian'
selectLang.value()=='Akkadian'