-1

    iframe name="_ifrm" id="_ifrm" src="/air/wfw/html/iframe/about.html"  
    title="_ifrm" height="368px" width="800" style="border:0;overflow- 
    y:auto;overflow-x:hidden;" scrolling="no" frameborder="0" 
    allowtransparency="true">

    div class="k1_yb_pop_wrap" style="width: 800px; background-color: 
    rgb(255, 255, 255);">

    class="k1_tac"      
    button class="k1_yb_btn k1_yb_btn_black k1_yb_btn_large" 
    type="button" onclick="airfn_confirm_1100100016('Y')" accept

    a class="close_pop" onclick="airfn_confirm_1100100016('N')"> closed 
    
        
    

and I tried closing the pop up with this code :

    driver.switchTo().frame(Common.driver.findElement(By.xpath("//*[@id=\"_ifrm\"]")));

    driver.findElement(By.xpath("/html/body/div[1]/div/p[2]/button")).click() ;

but, Test in error is ,

unknown error: Element <iframe name="_ifrm" id="_ifrm" 
src="/air/wfw/html/iframe/about.html" title="_ifrm" height="368px" 
width="800" style="border:0;overflow-y:auto;overflow-x:hidden;" 
scrolling="no" frameborder="0" allowtransparency="true" 
cd_frame_id_="01a42b9f9d1324c7bbec7a74e48a673b"></iframe> is not 
clickable at point (591, 390). Other element would receive the click: 
<div class="list_loading">...</div>(..)`enter code here`
Rabia Asif
  • 298
  • 3
  • 14
Narsian
  • 1
  • 1

1 Answers1

0

Some overlay is blocking to interact with the frame. You may need to wait till overlay or loader to go off the screen or page. You can try the following code, it may help you.

WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.className("list_loading")));

driver.switchTo().frame(Common.driver.findElement(By.xpath("//*[@id=\"_ifrm\"]")));

driver.findElement(By.xpath("/html/body/div[1]/div/p[2]/button")).click() ;
Murthi
  • 5,299
  • 1
  • 10
  • 15