Hi Experts,
I am using below code to check a particular text is exist in a page.
Please review the code whether it is a good one or not. Give me your
valuable suggestion to write effective codes.
require 'watir'
ie = Watir::IE.new
ie.goto("http://10.1.193.109/itrade/Login.aspx")
ie.maximize
ie.text_field(:name,"txtUserName").set("wcorp")
ie.text_field(:name,"txtPassword").set("wcorp123")
ie.button(:name,"btnSubmit").click
ie.form(:id,"form1").table(:id,"tbl0").cell(:id,"el6").click
ie.form(:id,"form1").table(:id,"tbl0").cell(:id,"el6").fire_event
("onMouseOver")
ie.form(:id,"form1").table(:id,"tbl7").cell(:id,"el59").click
ie.form(:id,"form1").span(:text,"Organisation").flash
if ie.text.include? "Organisation"
puts "Pass"
else
puts "Fail"
end
ie.form(:id,"form1").link(:text,"Logout").click
I am having one doubt, If the same text existing more than one time in
the same page how can we identify it?
Thanks,
Prince3105
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---