Элемент не доступен для взаимодействия. Ошибка при щелчке по дочернему элементу, находящемуся в родительском элементе, к ⇐ Python
Элемент не доступен для взаимодействия. Ошибка при щелчке по дочернему элементу, находящемуся в родительском элементе, к
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
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
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Mix-blend-mode Свойство в родительском элементе, но нежелательное в дочернем элементе
Anonymous » » в форуме CSS - 0 Ответы
- 114 Просмотры
-
Последнее сообщение Anonymous
-