I’ve a situation the place I 1st iframe (i.e mum or dad iframe) which has one button on it and clicking on it one other iframe will get open (youngster iframe). I’m able to change to Dad or mum iframe however once I click on on the button and tries to work together with Baby iframe I am not capable of do it. Are you able to counsel what needs to be the higher method to get this sort of eventualities working?
Right here is my Script:
public class Iframe {
public static void fundamental (String []args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", Constants.Chrome_Driver);
WebDriver driver = new ChromeDriver();
driver.handle().window().maximize();
driver.handle().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://automation.cloudaccess.host/administrator");
driver.findElement(By.id("mod-login-username")).sendKeys("admin");
driver.findElement(By.id("mod-login-password")).sendKeys("admin@123");
driver.findElement(By.id("mod-login-password")).submit();
driver.findElement(By.linkText("Parts")).click on();
Actions motion = new Actions(driver);
motion.moveToElement(driver.findElement(By.linkText("Messaging"))).construct().carry out();
driver.findElement(By.linkText("New Personal Message")).click on();
driver.findElement(By.className("wf-editor-header")).click on();
new WebDriverWait(driver, 20).till(ExpectedConditions.elementToBeClickable(By.xpath("//button[@id="jform_message_imgmanager"]"))).click on();
new WebDriverWait(driver, 20).till(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath("//iframe[contains(@src,'&plugin=imgmanager')]")));
new WebDriverWait(driver, 20).till(ExpectedConditions.elementToBeClickable(By.xpath("//*[@id="browser-actions"]/a[@id="help"]"))).click on();
new WebDriverWait(driver, 20).till(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath("//iframe[@id="mce_inlinepopups_50_ifr"]")));
new WebDriverWait(driver, 20).till(ExpectedConditions.elementToBeClickable(By.xpath("//*[@id="imgmanager.insert"]/i[@class="icon-file"]"))).click on();
driver.give up();
}
}
Error in getting:
Exception in thread "fundamental" org.openqa.selenium.TimeoutException: Anticipated situation failed: ready for body to be obtainable: By.xpath: //iframe[@id="mce_inlinepopups_50_ifr"] (tried for 20 second(s) with 500 milliseconds interval)
at org.openqa.selenium.assist.ui.WebDriverWait.timeoutException(WebDriverWait.java:81)
at org.openqa.selenium.assist.ui.FluentWait.till(FluentWait.java:271)
at testScripts.Iframe.fundamental(Iframe.java:53)
Attributable to: org.openqa.selenium.NoSuchElementException: Can not find a component utilizing By.xpath: //iframe[@id="mce_inlinepopups_50_ifr"]
For documentation on this error, please go to: http://seleniumhq.org/exceptions/no_such_element.html
Construct data: model: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
System data: host: 'vowellt4', ip: '127.0.1.1', os.identify: 'Linux', os.arch: 'amd64', os.model: '4.15.0-24-generic', java.model: '1.8.0_171'
Driver data: driver.model: unknown
at org.openqa.selenium.assist.ui.ExpectedConditions.lambda$findElement$0(ExpectedConditions.java:896)
at java.util.Non-compulsory.orElseThrow(Non-compulsory.java:290)
at org.openqa.selenium.assist.ui.ExpectedConditions.findElement(ExpectedConditions.java:895)
at org.openqa.selenium.assist.ui.ExpectedConditions.entry$000(ExpectedConditions.java:44)
at org.openqa.selenium.assist.ui.ExpectedConditions$17.apply(ExpectedConditions.java:517)
at org.openqa.selenium.assist.ui.ExpectedConditions$17.apply(ExpectedConditions.java:513)
at org.openqa.selenium.assist.ui.FluentWait.till(FluentWait.java:248)
... 1 extra