#290 special characters stops select method finding the string

Version_2.next
open
5
2012-09-15
2012-07-13
No

I am using WatiN 2.1.0 with Coypu and am trying to use it to select an option in a drop-down list.

If the option starts with a special character, e.g. ( or % the string is not found.
An example drop-down I have this problem with is:


<select id="ddlOption" class="small" style="width:100px;" name="ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder1$ddlOption">
<option value="1">% funding</option>
<option value="2" selected="selected">abs value</option>
<option value="3">% off list price</option>
</select>

So if I do:
browser.Select("abs value").From("ddlOption);
it is selected, but trying to get the first option will fail unless I select 1 for the value.

The error given is:
Test method SmokeTestScenario threw exception:
WatiN.Core.Exceptions.ElementNotFoundException: Could not find OPTION element tag matching criteria: 'Attribute 'innertext' equals '% funding' ignoring case' Or 'Attribute 'value' equals '% funding' ignoring case' at http://site

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks