1

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

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

2 Comments

wow that did it. I had tried to switch to the main modal that launches not the ind iframe. 2 hours of my life I will never get back
@AdamPrax the link is broken

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.