Firebug command line allows executing JavaScript expressions within context of the current page. Firebug also provides a set of built in APIs and one of them is
cd()
.Lets consider below iframe
<iframe id="testID" name="testName" src="iframe.html" />
cd(document.getElementById("testID").contentWindow);
switch to a frame by IDcd(window.frames[0]);
switch to the first frame in the list of framescd(window.frames["testName"]);
switch to a frame using by namecd(window.top);
switching back to the top level window
Happy Coding .. :)
Regards,
SantoshSarma
I am referring ur blog this is very helpful for me...
ReplyDeletehttp://stackoverflow.com/questions/12729265/switch-tabs-using-selenium-webdriver
above given link is very useful for me but in ur answer second statement is not working i dont know why...
new Actions(driver).sendKeys(driver.findElement(By.tagName("html")), Keys.CONTROL).sendKeys(driver.findElement(By.tagName("html")),Keys.NUMPAD1).build().perform();
what should i do for going back to my old tab.
Thanks n Best regards
pritam Gupta
pritam.jec58@gmail.com