Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Selenium overlay button cannot be clicked

I am having some issues with one website’s button.
Here is my driver function.

def get_driver():
    options = webdriver.ChromeOptions()
#     options.add_argument("--headless")
    options.add_argument("--incognito")
    driver = webdriver.Chrome(executable_path = ChromeDriverManager().install(),     chrome_options = options)
    driver.get('https://online.depo-diy.lt')
    return driver

driver = get_driver()

Problem is that I cannot select and click anything from the drop down manu when I start my driver. Website request to select a store and then you can press OK to proceed.
I check for iframes with driver.window_handles but it shows only one frame. This seems like overlay, but I don’t know what to do with it.

Only button I can find is "//button[@class='ms-Button-flexContainer flexContainer-51']".
Here is the screenshot, don’t know how to copy HTML output..
enter image description here
Blockquote

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try this:

WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ModalFocusTrapZone30")))
driver.find_element(By.ID, "Dropdown31-option").click()
time.sleep(1)
driver.find_element(By.XPATH, ".//*[contains(text(), 'Šilutės 28B, Klaipėda')]").click()
time.sleep(1)
driver.find_element(By.XPATH, ".//*[@data-automationid='splitbuttonprimary']//span[text()='OK']").click()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading