title: Is there a way to control the mouse wheel in headless browser
body: <p>I have been looking for a way to control the mouse wheel to simulate zooming actions for a UI test to run on Selenium headless browser.
  This is to carry out tests on webGL images (not available through DOM, only the canvas is available) displayed in a web browser.</p>
  
  <p>So far I have been able to control the mouse wheel using pynput which works fine when I run the test on my PC in non headless browser but doesn't do anything when run in headless mode.
  My understanding is that the mouse wheel control is done via positioning on the screen which when it is used in headless mode doesn't exist. When the test is run, the event is actually triggered on my PC screen as opposed to in the headless browser.</p>
  
  <p>Looking at the [ActionChains] (<a href="https://seleniumhq.github.io/selenium/docs/api/py/_modules/selenium/webdriver/common/action_chains.html#ActionChains.click" rel="nofollow noreferrer">https://seleniumhq.github.io/selenium/docs/api/py/_modules/selenium/webdriver/common/action_chains.html#ActionChains.click</a>) class which works fine for click, drag and drop, etc. in headless mode, it seems to be using the <a href="https://www.w3.org/TR/uievents/#events-mouse-types" rel="nofollow noreferrer">w3c UI events</a>.
  I have tried to change the click() function to use button '4' (allegedly mouse wheel) instead of '0' to see if that works but I get an error message saying button '4' is invalid.</p>
  
  <p>I am now at the limit of my knowledge in python/events/selenium and not seeing anyone having done this before makes me wonder if it's even possible.</p>
  
  <p>Any help/tips or solutions for this would be greatly appreciated.</p>
  
  <p>Thanks,
  Sylvain</p>