P
Pranjal Jain
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.to_s)
$ie.text_field
name, '{actionForm.password}').set($password.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
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
$ie.text_field
$ie.button
if($ie.link
begin
$ie.link
sleep 3
cw = IE.attach( :title, /Timesheet - Add Comments/i )
a = "Watir Automation using Ruby "
cw.text_field
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
else
puts "nthng"
end
#cw.link( "javascript:window.close()" ).click
end
else
puts "Sorry"
end
thanks inadvance