LivesinReality
New Member
Could you please help me in following scenario? Below is the html code ..\[code\] <div> <iframe id="cq-cf-frame "> <iframe id="gen367"> <body spellcheck="false" id="CQrte" style="height: 255px; font-size: 12px; font-family:tahoma,arial,helvetica,sans-serif; background-image: url("/libs/cq/ui/widgets/themes/default/ext/form/text-bg.gif"); background-repeat: repeat-x; background-attachment: fixed;"> <p>4t43t4<br></p> </body > </iframe> </iframe> </div> \[/code\]In this scenario there is an iframe under iframe. And I have to select the outer Iframe to go to inner Iframe and write in the body( Winch is in the inner Iframe), Next I have to come out from the inner iframe to outer iframe and click on OK button( which is outer iframe).Following is my code1-driver.switchTo().frame("cq-cf-frame");2-driver.findElement(By.css("#extdd-9 > div.tblRow > input.edititem).click();3-driver.switchT().Frame("cq-gen379");4-driver.findElement(By.id("CQrte").sendKeys("Tnx"); 5-selenium.selectFrame("relative=up");6-driver.findElement(By.xpath("//button[text()='OK']")).click(); Following is my problem..My test code is working fine up to line number 4 i.e. writing into the body. But I want to come out from inner to outer iframe it says that the element //button[text()='OK not found.I tried with using index, Parent , relative, But No luck.NOTE: If I don