hi angrez i am resending you the code with the comments in the last 10 lines. As i am new to watir i am not able to catch the line where the exception is comming.
require 'watir' require 'test/unit' include Watir class TC_mail_yahoo_check < Test::Unit::TestCase puts "## Opening the Mail.Yahoo.com site" sleep 1 ie = IE.new ie.goto("http://mail.yahoo.com") ie.maximize() puts "## Login and Password Entered" sleep 1 ie.text_field(:name, "login").set("loginname") ie.text_field(:name, "passwd").set("password") ie.button(:value, "Sign In").click() puts "## Checking the mail box" ie.button(:id, "checkmailbutton").click() # select first message. puts "## Selecting the First Mail" ie.radio(:id, "folderviewmsg0checkbox").set() # click on mark button so as options can be displayed puts "## Clicking the Mark Button" ie.button(:value, "Mark").click() puts "## Element started" ------------------> This message is being displayed # select element that has text "Mark as Read" #element = ie.element_by_xpath("//lihttp://contains(.,'Mark as Read')") ## old code ie.element_by_xpath("//li[contains(.'Mark as Read')]") ## New code provided by you # Print properties of the element just to make sure you selected correct element. ## commented or not commented same exception comming element.value ## commented or not commented same exception comming element.tagName ## commented or not commented same exception comming element.innerHTML ## commented or not commented same exception comming # fire click event. element.click() ## commented or not commented same exception comming puts "## Element ended" -----------------------> THis message is not displayed end Note: The message "Element started" is displayed in the window, but without showing "Element ended" it is closing or ending the session. I am not sure which part of the code has to be kept or which has to be removed. thanks _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general