Selenium WebDriver how to to handle custom scroll event in Angular application on Firefox 115
I'm trying to debug I'm working with an scenario with Selenium WebDriver where it fails to trigger a custom scroll event in my Angular application while running on Firefox 115. The application makes use of a custom scroll listener that loads more data as the user scrolls down. However, when I attempt to simulate scrolling using Selenium, it does not appear to invoke the necessary event handlers, which results in no additional data being loaded. I've tried using the following code snippet to perform the scroll: ```python from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import time # Initialize the Firefox WebDriver driver = webdriver.Firefox() # Navigate to the page driver.get('https://example.com/my-angular-app') actions = ActionChains(driver) # Attempt to scroll down the page for _ in range(5): # Scroll down 5 times actions.send_keys(Keys.PAGE_DOWN).perform() time.sleep(1) # Wait for the data to load # Check the page source to see if new data has been loaded print(driver.page_source) ``` Despite executing this script, I'm not seeing any new data being rendered in the UI, and the output of `driver.page_source` does not indicate any changes after scrolling. Additionally, I have verified that the scroll handler is working correctly when manually scrolling in the browser, which leads me to believe that the scenario is related to the Selenium interaction. I've also attempted to manually invoke the scroll event using JavaScript: ```python driver.execute_script('window.scrollTo(0, document.body.scrollHeight);') ``` However, this does not seem to trigger the scroll event either. The console does not show any errors, and there is no indication that my Selenium actions are being recognized by the Angular application. Is there a known scenario with Selenium and custom scroll events in Firefox, or am I missing something in my implementation? Any suggestions on how to effectively trigger the scroll event from Selenium would be greatly appreciated. I'm working with Python in a Docker container on CentOS.