Search code examples
pythonseleniummouseevent

Use selenium and python to move mouse outside of web page area


I need to test the exit intent form on this page: https://www.graphicproducts.com/guides/5s-system/

When the mouse pointer is moved outside of the web page area a popup window appears. I then need to enter text into the form in the popup.

How can I move the mouse outside of the web page area to trigger the popup? Note, the mouse pointer doesn't need to leave the window entirely, it could go up to the address bar/refresh button area (really any where but the web page area).

I'm using python and selenium.

Thanks!


Solution

  • No! this can't be done via selenium!

    You can use PyAutoIt together with the selenium just to get the popup to show...

    Note: you will need to switch.to() the new popup...

    It may look something like: switch.to('//div[@id=exitIntentPopup]')

    Hope this helps you!