kaliiiiiiiiii / Selenium-Profiles

undetected Selenium using chromedriver and emulation / device profiles
Other
255 stars 29 forks source link

AttributeError: move_to requires a WebElement #111

Closed wealthr closed 7 months ago

wealthr commented 7 months ago

I get the error in the title when i try this code


from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium_driverless.webdriver import ChromeOptions
from selenium_driverless.types.by import By
from selenium_profiles.scripts.driver_utils import TouchActionChain

profile = profiles.Windows()  # or .Android
options = ChromeOptions()
# options.add_argument("--headless=new")
driver = Chrome(profile, options=options, driverless_options=True)

# initialise touch_actions
chain = TouchActionChain(driver)

driver.get("https://cps-check.com/multi-touch-test")

touch_box = driver.find_element(By.XPATH,'//*[@id="box"]') # Get element

chain.touch_and_hold(touch_box)
chain.pause(10)
chain.release(touch_box)

# perform actions
chain.perform()

# now you should see a touch indication
# point on the Website for 10 seconds

# quit driver
input('Press ENTER to quit Driver\n')
driver.quit()
kaliiiiiiiiii commented 7 months ago

ActionChains aren't supported for selenium-driverless

wealthr commented 7 months ago

is there any other way to use touch features with driverless?

kaliiiiiiiiii commented 7 months ago

Nope, not yet. Planning to implement tho.

wealthr commented 7 months ago

OK