Hey Jarmo, 

I ran the line of code you asked me to and it returned 1.

There are only two options in the drop down, YES and NO. I found that after 
I slapped rescue nil at the end, i was able to get passed that step. Not 
optimal, but it will suffice for now. I also found a couple of places where 
this happens, and they all have to deal with ASP.NET postbacks.

I am able to continue with the migration for now. I have run into another 
issue regarding the new Alert API. When I run old execute_script I get the 
following error:

Then /^I kill the popups$/ do
  @browser.execute_script "window.confirm = function() { return true; }"
  @browser.execute_script "window.alert = function() { return true; }"
  @browser.execute_script "window.prompt = function() { return true; }"
end

# features/step_definition/definition.rb:30
(in OLE method `execScript': )
    OLE error code:80020101 in <Unknown>
      Could not complete the operation due to error 80020101.
    HRESULT error code:0x80020009
      Exception occurred. (WIN32OLERuntimeError)
./features/step_definition/definition.rb:31:in `/^I kill the popups$/'
features\templates\aih-df1.feature:12:in `Then I kill the popups'

--Enrique

On Wednesday, August 22, 2012 10:20:38 AM UTC-4, Jarmo Pertman wrote:
>
> Is it possible that your select(/#{value}/) matches more than one option 
> element?
>
> The code works currently like this:
> 1. finds the select element
> 2. checks if it is disabled - it is not disabled in your case seeing from 
> the stacktrace
> 3. finds all option elements, which match the value
> 4. one-by-one checks if option is not disabled and selects it
>
> It might be, that you will find more than one option elements and when 
> first gets selected then others are disabled (even for some very short 
> period) and then it blows up. Could it be the case?
>
> Check if more than one option is found like this:
>
> puts @browser.select_list(:id => 
> "ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList").options(:value 
> => /#{value}/).size
>
>
> Jarmo Pertman
> -----
> IT does really matter - http://itreallymatters.net
>
>
> On Wednesday, August 22, 2012 3:46:10 PM UTC+3, enroxorz wrote:
>>
>> The site is written in ASP.NET, so it's a bit out of my knowledge to be 
>> honest BUT I did find a work around that somehow doesnt blow up
>>
>> @browser.select_list(:id => 
>> "ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList").when_present(60).select(/#{value}/)
>>  
>> rescue nil
>>
>> The value is still set AND it doesnt blow up. I am sorry I couldnt get an 
>> exact error in case it needs to be patched, but at least there is a work 
>> around for anyone who needs it.
>>
>> Thanks guys for all the help!
>>
>> On Wednesday, August 22, 2012 3:08:07 AM UTC-4, Željko Filipin wrote:
>>>
>>> On Tue, Aug 21, 2012 at 9:53 PM, enroxorz <[email protected]> wrote:
>>> > Is there anything else I can give you that might help?
>>>
>>> Link to the page, if it is public. Or link to the page that has the same 
>>> problem.
>>>
>>> Željko
>>> --
>>> filipin.eu 
>>>  
>>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to