오은아은아
오은아은아

Reputation: 129

in selenium can't switch handle new popup layer

this is html part. it appear new layer popup in widows.

<div style="top: 20px;" id="appInstallSuggestLayer" class="ly_prm_app">
    <div class="prm_app_wrap">
        <div class="prm_app_header">
            <strong class="blind">today news</strong>

but, it is no iframe name in source and, no windows alert and,

no new windows pop up.

it appear new layer popup over 'mainframe' in browser, but iframe name is no.

so I can't hadle

what can I handle this layer popup??

Upvotes: 0

Views: 1447

Answers (1)

Saurabh Gaur
Saurabh Gaur

Reputation: 23825

If there is no frame or iframe no need to switch anywhere just need to implement WebDriverWait to wait until popup visible as below :

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

wait = WebDriverWait(driver, 20)
pop_up = wait.until(EC.visibility_of_element_located((By.CLASS_NAME,'prm_app_wrap')))

Hope it helps...:)

Upvotes: 1

Related Questions