Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome Chrome拖放不适用于具有Selenium操作类的Canvas元素_Google Chrome_Selenium_Automation - Fatal编程技术网

Google chrome Chrome拖放不适用于具有Selenium操作类的Canvas元素

Google chrome Chrome拖放不适用于具有Selenium操作类的Canvas元素,google-chrome,selenium,automation,Google Chrome,Selenium,Automation,我使用的是Selenium 2.53.1、Selenium支持类2.53.1和Chrome版本59.0.3071.115以及Chrome驱动程序2.30。看起来拖放操作不是在Chrome上运行,而是在firefox上运行。它一直工作到昨天,但突然停止工作,我检查了一些升级是否破坏了它的工作,但它看起来不像。以下是我的代码: public void DragAndDrop(IWebDriver driver, By source, By destination, int sourceX, int

我使用的是Selenium 2.53.1、Selenium支持类2.53.1和Chrome版本59.0.3071.115以及Chrome驱动程序2.30。看起来拖放操作不是在Chrome上运行,而是在firefox上运行。它一直工作到昨天,但突然停止工作,我检查了一些升级是否破坏了它的工作,但它看起来不像。以下是我的代码:

 public void DragAndDrop(IWebDriver driver, By source, By destination, int sourceX, int sourceY, int destinationX, int destinationY)
        {
            try
            {
                IWebElement sourceElement = FindElement(driver, source);
                IWebElement destinationElement = FindElement(driver, destination);
                Actions Actions = new Actions(driver);
                Actions.MoveToElement(sourceElement, sourceX, sourceY).ClickAndHold().Build().Perform();
                Actions.MoveByOffset(5, 0);
                Actions.MoveToElement(destinationElement, destinationX, destinationY).Release().Build().Perform();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }

检查sourceX和sourceY是否正确


如果正确,请使用dragAndDropBy(sources、xInteger、yInteger)。

检查sourceX和sourceY是否正确


如果它们是正确的,请使用dragAndDropBy(sources、xInteger、yInteger)。

与您的情况类似,我的脚本一夜之间停止工作。
降低铬含量是一个临时解决方案

与您的情况类似,我的脚本一夜之间停止工作。
降低铬含量是一个临时解决方案

源X和Y是正确的,这就是它在Firefox中工作的原因,我正在将元素从一个画布(HTML5元素)拖动到另一个画布,因此我无法使用它。源X和Y是正确的,这就是它在Firefox中工作的原因,我正在从一个画布(HTML5元素)拖动元素到另一个画布,所以我无法使用此。请不要在回答中提问,你需要使用评论,通过贡献社区,快速获得50个代表。你降级到哪个chrome驱动程序?请不要在回答中提问,你需要使用评论,快速获得50个代表,通过对社区的贡献。你把chrome的驱动程序降级到了哪一个?