lundi 27 mars 2017

How can i close my iframe Fancybox and return to parent page in selenium webdriver?

How can i close my iframe Fancybox and return to parent page in selenium webdriver? I am using iframe to upload an image and i need to submit my from on parent page.

    WebElement browse_btn=driver.findElement(By.xpath(".//*[@id='myForm1']/input[2]"));
           browse_btn.sendKeys("C:\\Users\\user1\\Downloads\\test1.jpg");
           WebElement upload_btn=driver.findElement(By.xpath(".//*[@id='myForm1']/input[3]"));
           upload_btn.click();
           WebElement progress_bar=driver.findElement(By.xpath(".//*[@id='bar']")) ;
           WebDriverWait wait = new WebDriverWait(driver, 200);
           wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath(".//*[@id='percent']"), "100%"));
           Thread.sleep(5000);
           driver.switchTo().defaultContent();

Aucun commentaire:

Enregistrer un commentaire