简体   繁体   中英

Selenium WebDriver can't get elements

I'm writing tests for a web site using Selenium WebDriver. I have looked at element's id & xpath in firebug and firepath. Ids exist but I get an exception. Could you please provide help? 在此处输入图片说明

Please, check if this element is visible when Selenium tries to catch it. If an element is hidden (for example, if you attempt to get menu item which displays only on hover event), Selenium doesn't see it too.

You can use the HTML Agility pack to create a HtmlNode of your page, and then query it by XPath to find your element. The benefit being that you need not be worried about the visibility of the elements to grab them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM