Элемент не доступен для взаимодействия. Ошибка при щелчке по дочернему элементу, находящемуся в родительском элементе, кPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Элемент не доступен для взаимодействия. Ошибка при щелчке по дочернему элементу, находящемуся в родительском элементе, к

Сообщение Anonymous »


There are 2 similar buttons(lets call them "Install" button) in the DOM, but i need to select the button using a text that is only available for the html block that button is in.

This is the code i used and the below is the output i got.

disable_operation_button = driver.find_element(By.XPATH, "//span[contains(text(), 'Disable Operation Re-executing')]") parent_element_disable_button = disable_operation_button.find_element(By.XPATH, "../../../..") print(parent_element_disable_button.get_attribute("outerHTML")) print("**************isdisplayed") # Printing whether the Install button is displayed print(parent_element_disable_button.find_element(By.XPATH, "//button[@class='ant-btn ant-btn-primary']//span[contains(text(), 'Install')]").is_displayed()) parent_element_disable_button.find_element(By.XPATH, "//button[@class='ant-btn ant-btn-primary']//span[contains(text(), 'Install')]").click() And the output for parent_element_disable_button is below(please note that in the last 2 lines the Install button is there,

Disable Operation Re-executing Schedule Install Block Uninstall Install For the output of displaying whether the Install button element is present in DOM it shows False.

**************isdisplayed False When clicking on the install button (parent_element_disable_button.find_element(By.XPATH, "//button[@class='ant-btn ant-btn-primary']//span[contains(text(), 'Install')]").click()) it throws the following error.

selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable Can you please suggest a way to fix this or select the button?


Источник: https://stackoverflow.com/questions/780 ... n-a-parent
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»