WebDriver: How to check if an page object web element exists?

后端 未结 8 1715
鱼传尺愫
鱼传尺愫 2020-12-25 14:13

How to check if an Element exists, when using Page Objects with webdriver.

So far I am doing it this way.

DefaultPage defaultPage = PageFactory.initE         


        
8条回答
  •  清歌不尽
    2020-12-25 14:43

    Webdriver is designed to throw an exception if an element is not found, So there aren't any methods to verify presence of an element in Webdriver.

    Check this - http://groups.google.com/group/webdriver/browse_thread/thread/909a9b6cb568e341

提交回复
热议问题