From: Pranjal Jain Date: 2008-05-06T21:54:59+09:00 Subject: Script not working HI All I am having a script which is not working when I am writing it inside a method def addcomment. But when I am writing it outside the method; it starts working. Can somebody explain me why this is so? the script is as follows : b = 0 $ie = IE.new $ie.goto("https://tms.corp.xyz.com/") $ie.bring_to_front $ie.maximize $ie.text_field(:name, '{actionForm.username}').set($username[b].to_s) $ie.text_field(:name, '{actionForm.password}').set($password[b].to_s) $ie.button(:name, 'actionOverride:validateLogin.do').click if($ie.link(:class,"linkTableBody").exists?) begin $ie.link(:class,"linkTableBody").click sleep 3 cw = IE.attach( :title, /Timesheet - Add Comments/i ) a = "Watir Automation using Ruby " cw.text_field(:name,"{actionForm.resComm}").set(a) cw.button( "Save Comments" ).click if a.length >1024 puts "Number of characters exceed the space specified" #check_for_popups() startClicker( "OK ", 7 , "User Input" ) #cw.text_field(:name,"{actionForm.resComm}").clear else puts "nthng" end #cw.link( "javascript:window.close()" ).click end else puts "Sorry" end thanks inadvance :) -- Posted via http://www.ruby-forum.com/.