Are you using Selenium IDE to record and play back scripts? Or are you using WebDriver? If you are using WebDriver, which language?
I write my Selenium code using Java. If I have:
WebDriver driver = new FirefoxDriver();
driver.get("url of your website goes here.");
and the web page has frames, I need to switch to each frame to be able to access it. For example,
System.out.println(driver.getPageSource());
will print the same thing you see when you do a "View Source" on the web page. If you want to see the source code of the iframe (or interact with it), use:
driver.switchTo().frame("ITSFRAME1");
Now if you do:
System.out.println(driver.getPageSource());
you will see the source code for the iframe. If you do any Selenium actions, they will apply to the iframe only. If you need to get back to the main web page, use:
driver.switchTo().defaultContent();
On Saturday, 25 August 2012 08:04:30 UTC-4, micha182 wrote:
Hey guys,
Selenium really is a nice thing, but currently I am facing the following issue.
I am trying to automate some actions on a website that consists of three iframes.
Via Firefox the content of each of them is displayed correctly, there are divs, links, and many further elements visible.
But if I try to review the source code of this website none of these elements is available and as a consequence I cannot perform any selenium commands it.
<iframe id="ITSFRAME1" name= "itsframe1_20120825115757.1259930 " noresize="1" frameborder="0" framespacing="0" border="0" onload="showIFrame(0);" src="about:blank" > </iframe>
My question now is: How can I make dynamically loaded content available?
I guess it cannot be too hard, since the Internet Explorer does display it in its sourcecode-view-mode.
Regards
Michael