Как обращаться с модальным диалоговым окном в Selenenium, где выбранное значение было отражено в модальном? - PullRequest
0 голосов
/ 23 мая 2019

enter image description here

  1. Выбрано значение из редактора.
  2. Нажмите модальную кнопку, чтобы открыть модал.
  3. Выбранное значение отражается.

    WebElement classname = driver.findElement(By.cssSelector("editorid")); //Get Iframe
    String val = "ValuetoputinEditor";
    final Boolean valueavailableiniframe = getValueIframe(classname, val);   // Function to Get value saved in Iframe
    //If value getting form Ifram then click on Modal
    if(
        valueavailableiniframe.equals(true)
    ){
        // Click on Modal
        WebElement classname1 = driver.findElement(By.xpath("modalbuttonid"));
        classname1.click();
        //Switch to active element here in our case its model dialogue box.
        driver.switchTo().activeElement();
        WebElement body = driver.findElement(By.id("myModalLabel")); //Get Iframe body
    }
    
...