selenium WebDriver not finding elements on a modal
I am using selenium webdriver not straight selenium-rc
I have a modal login prompt that come up when you click the login button. Its just a simple div such as -> that has a few frame containers in it.
I can get selenium to open the modal and开发者_开发知识库 selenium can find the modal cause I check to see if it is up so it does no the container is open
enderedWebElement resultsDiv = (RenderedWebElement)driver.findElement(By.className("logincontentcontainer"));
But it cannot find any controls on the modal such as text box or buttons. I have tried looking by name, id, classname.... no luck. firebug see's the controls fine. I have several sleeps to make sure its not a race condition.
I should add the modal that comes up is a container with 2 iframes the controls I need are in 1 iframe what contains a form with the controls on that form. not sure if that matters
Are you switching to the frame before you try to find any elements in it? If you're not, that could be your problem.
driver.switchTo().frame("frameName");
http://seleniumhq.org/docs/09_webdriver.html#moving-between-windows-and-frames
精彩评论