Skip to content

Instantly share code, notes, and snippets.

View claudiokc's full-sized avatar

Claudio Cáceres claudiokc

View GitHub Profile
@claudiokc
claudiokc / #wd-drop-file.py
Created May 24, 2022 16:16 — forked from florentbr/#wd-drop-file.py
Selenium - Drop a file from the desktop on a drop area
from selenium import webdriver
from selenium.webdriver.remote.webelement import WebElement
import os.path
# JavaScript: HTML5 File drop
# source : https://gist.github.com/florentbr/0eff8b785e85e93ecc3ce500169bd676
# param1 WebElement : Drop area element
# param2 Double : Optional - Drop offset x relative to the top/left corner of the drop area. Center if 0.
# param3 Double : Optional - Drop offset y relative to the top/left corner of the drop area. Center if 0.
# return WebElement : File input