[Wtr-general] Can anyone solve this problem..???????
Nathan
forum-watir-users at openqa.org
Wed Dec 6 10:08:43 EST 2006
Yeah, the reason why you're having that error is that you have only defined @ie in your first method. That makes that a local instance to that method. Because of this, when you try and use it in your second method it returns nil or in your case 'undefined'. If you want to use the @ie variable globally then you might do one of two things. 1) Define the variable outside of your methods but inside of your class as a class variable or member that can be accessed by all of your methods, or 2) define @ie as a global variable (I'm not sure if you can keep the '@' part in this case) by calling it $ie. The $ tells Ruby to treat the variable like a global variable no matter where you define it.
Nathan
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5636&messageID=15734#15734
More information about the Wtr-general
mailing list