pytest-dev / pytest-selenium

Plugin for running Selenium with pytest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drop element not working (react dnd)

iamkabulov opened this issue · comments

# Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

class TestDND2():
  def setup_method(self, method):
    self.driver = webdriver.Chrome()
    self.vars = {}
  
  def teardown_method(self, method):
    self.driver.quit()
  
  def test_dND2(self):
    self.driver.get("https://codesandbox.io/s/great-montalcini-8cs99")
    self.driver.set_window_size(1552, 840)
    time.sleep(20)
    self.driver.switch_to.frame(0)
    
    
    dragged = self.driver.find_element(By.CSS_SELECTOR, ".ant-table-row[index='0']")
    dropped = self.driver.find_element(By.CSS_SELECTOR, ".ant-table-row[index='1']")
    actions = ActionChains(self.driver)
    #actions.drag_and_drop(dragged, dropped).release(dragged).release().perform()
    actions.click_and_hold(dragged).perform()
    actions.move_to_element(dropped).perform()
    actions.release(dropped).perform()
    time.sleep(15)
    self.driver.close()

in console you can see logs when drag begins and drag ends.

Your code is not using pytest-selenium

Your code is not using pytest-selenium

well, could you help me with this issue?

Try pip install -U --pre selenium and see if the latest alpha solves the issue.

Try pip install -U --pre selenium and see if the latest alpha solves the issue.

It does not work((

Try to go to seleniumHq or the selenium slack to get help with your issue. It's beyond the scope of pytest-selenium.