Selenium element could not be scrolled into view
Just click on the parent element (with './..') and it'll work fine:
tos_checkbox = brower.find_element_by_xpath("//input[@id='mat-checkbox-1-input']/./..")
tos_checkbox.click()
Regards !
Element <option> could not be scrolled into view
If the option menu its not hidden inside a wrapper, example another dropdown menu or nested page try with actions moving to it.
from selenium.webdriver.common.action_chains import ActionChains
element = driver.find_element_by_xpath("//select[@name='city']")
actions = ActionChains(driver)
actions.move_to_element(element).perform()
or with javascript executor
driver.execute_script("arguments[0].scrollIntoView();", element)
Element(button) could not be scrolled into view
The error "selenium.common.exceptions.ElementNotInteractableException: Message: Element could not be scrolled into view"
implies that the element which your program was trying to interact with could not be scrolled into view.
To overcome that you can introduce WebDriverWait
and click or use element.location_once_scrolled_into_view
first and then click on the element.
Or you can use Javascript's executor
to click on the element.
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
WebDriverWait(driver,30).until(EC.element_to_be_clickable((By.CSS_SELECTOR,"#btnSearch"))).click()
OR
ok3=driver.find_element_by_css_selector('#btnSearch')
ok3.location_once_scrolled_into_view
ok3.click()
OR
ok3=driver.find_element_by_css_selector('#btnSearch')
driver.execute_script("arguments[0].click();",ok3)
Related Topics
How to Resolve Java.Lang.Noclassdeffounderror: Javax/Xml/Bind/Jaxbexception
How to Create Comma Separated String in Single Quotes from Arraylist of String in Java
Reading Data from Nested Json Object Using Java
Adb Cannot Connect to Daemon At Tcp:5037
Password Validate 8 Digits, Contains Upper, Lowercase, and a Special Character
How to Sort Json Object in Java
How to Get Image Height and Width Using Java
How to Acknowledge Current Offset in Spring Kafka for Manual Commit
How to Exclude a Dependency from Parent'S Project in Maven
Create List of Object from Another Using Java 8 Streams
Java H2 In-Memory Database Error: Table Not Found
Broadcast Receiver Is Not Working When Application Is Removed from Background
Testing Two Json Objects for Equality Ignoring Child Order in Java
Regex to Match Words of a Certain Length
How to Pass Variables Between Cucumber-Jvm Steps
Use a Binary Search on an Int Array Sorted in Descending Order