# Random undefined method error

**URL:** <https://www.ruby-forum.com/t/random-undefined-method-error/147170>\
**Category:** Ruby\
**Created:** [August 29, 2008, 12:50am UTC](https://www.ruby-forum.com/t/random-undefined-method-error/147170 "2008-08-29T00:50:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ythu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e56c9b/32.png) [@ythu](https://www.ruby-forum.com/u/ythu)\
**Post date:** [August 29, 2008, 12:50am UTC](https://www.ruby-forum.com/t/random-undefined-method-error/147170/1 "2008-08-29T00:50:57Z")

</div>

Hi,  
I have the following nested loop, it gives undefine method “radio”  
sometimes.  
its wierd because the error occurs randomly.sometimes it runs fine,  
sometimes at start of execution and sometimes half way through.  
I m running watir on ruby 186.26  
thanks for any advices

```
SeperatedBy.each do|SperatedByVal|
$ie.select_list(:id,"cboSetValue").select(SperatedByVal)

```

Units.each do |unit|  
$ie.select\_list(:id,“cboUnits”).select(unit)

```
$ie.button(:id,"imgBtnGo").click
$ie.wait

```

#export csv file  
$ie.link(:id,“lnkExportData”).click  
ieEX.radio(:id,“chkExport”).set  
end  
end

---

<div class="post-metadata">

**Author:** ![ythu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e56c9b/32.png) [@ythu](https://www.ruby-forum.com/u/ythu)\
**Post date:** [August 29, 2008, 5:58pm UTC](https://www.ruby-forum.com/t/random-undefined-method-error/147170/2 "2008-08-29T17:58:19Z")

</div>

Can you post the whole call stack - I don’t why this would be occurring

- but maybe the call stack will provide a clue about where the  
‘undefined method’ error is coming from ?

Yt Hu wrote:

> Hi,  
> I have the following nested loop, it gives undefine method “radio”  
> sometimes.  
> its wierd because the error occurs randomly.sometimes it runs fine,  
> sometimes at start of execution and sometimes half way through.  
> I m running watir on ruby 186.26  
> thanks for any advices
> 
> ```
> SeperatedBy.each do|SperatedByVal|
> $ie.select_list(:id,"cboSetValue").select(SperatedByVal)
> 
> ```
> 
> Units.each do |unit|  
> $ie.select\_list(:id,“cboUnits”).select(unit)
> 
> ```
> $ie.button(:id,"imgBtnGo").click
> $ie.wait
> 
> ```
> 
> #export csv file  
> $ie.link(:id,“lnkExportData”).click  
> ieEX.radio(:id,“chkExport”).set  
> end  
> end
