How to find an error if Element not found?

10 views
Skip to first unread message

ankur

unread,
Nov 5, 2014, 1:38:18 AM11/5/14
to seleni...@googlegroups.com

How to find an error if Element not found?

For example, if "Contact Us" link not found then Else part should be executed but it is not 

abc=driver.find_element(:link, "Contact Us").displayed?
    if abc==true
   puts "-Contact Us link displayed on menu item on page"
   else puts "-Contact Us link is not getting dispalyed on menu item on page"
    end
    
Reply all
Reply to author
Forward
0 new messages