Friday, July 30, 2010

Solved (eval):3:in `invoke': unknown property or method `readOnly' (WIN32OLERuntimeError)

I used to run my Waitr script in order to set the text field with a value and get the error:

(eval):3:in `invoke': unknown property or method `readOnly' (WIN32OLERuntimeError)

The problem had a simple solution.

These were the two elements in my html source.
<td valign="middle" align="center" id="textValue">
<input type="text" name="textValue" id="textValue">

I wanted to set the textfield to a specific value and my line in my Watir code looked like this

This resulted in Watir trying to set the first element with the value as both had the same id(it had a recognition problem), which was not actually a textfield and threw the error:

(eval):3:in `invoke': unknown property or method `readOnly' (WIN32OLERuntimeError)
HRESULT error code:0x80020006
Unknown name.
from (eval):3:in `readonly?'

Thus I had to find another unique recognition parameter and instead of 'id', and used 'name' instead

Changed my code in Watir to

Now it worked just fine!

No comments:

Post a Comment