You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried the new move_to() and it wasnt working. I thought its my code and tried a lot, but always the same error: ... failed: '>' not supported between instances of 'int' and 'NoneType'
I let Claude AI create a minimal code to proof:
import asyncio
from selenium_driverless import webdriver
async def test_move_to():
# Create driver
driver = await webdriver.Chrome()
try:
# Navigate to page
await driver.get("https://kaliiiiiiiiii.github.io/Selenium-Driverless/index.html")
await asyncio.sleep(1) # Wait for page load
# Find element
element = await driver.find_element("xpath",
"//div[@class='wy-menu wy-menu-vertical']//a[@href='api/WebELement.html']")
if not element:
print("Element not found")
return
print("Testing element.move_to()")
try:
await element.move_to()
print("element.move_to() succeeded")
except Exception as e:
print(f"element.move_to() failed: {e}")
await asyncio.sleep(1)
print("\nTesting pointer.move_to() with coordinates")
try:
# Get element position and size
location = await element.location
size = await element.size
print(f"Location: {location}, Size: {size}")
# Calculate center
x = location['x'] + size['width'] // 2
y = location['y'] + size['height'] // 2
print(f"Moving to coordinates: {x}, {y}")
# Move using pointer
pointer = driver.current_pointer
await pointer.move_to(x, y)
print("pointer.move_to() succeeded")
except Exception as e:
print(f"pointer.move_to() with coordinates failed: {e}")
await asyncio.sleep(2) # Wait to see the result
finally:
await driver.quit()
if __name__ == "__main__":
asyncio.run(test_move_to())
Log:
Testing element.move_to()
element.move_to() failed: '>' not supported between instances of 'int' and 'NoneType'
Testing pointer.move_to() with coordinates
Location: {'x': 0, 'y': 313}, Size: {'height': 30, 'width': 300}
Moving to coordinates: 150, 328
pointer.move_to() succeeded
Process finished with exit code 0
The text was updated successfully, but these errors were encountered:
Hey,
I tried the new move_to() and it wasnt working. I thought its my code and tried a lot, but always the same error:
... failed: '>' not supported between instances of 'int' and 'NoneType'
I let Claude AI create a minimal code to proof:
Log:
The text was updated successfully, but these errors were encountered: