Python 2.7 什么是AttributeError:对象没有属性';w3c';?

Python 2.7 什么是AttributeError:对象没有属性';w3c';?,python-2.7,selenium-webdriver,drag-and-drop,action,Python 2.7,Selenium Webdriver,Drag And Drop,Action,我正在尝试执行拖放,python webdriver。 但我并不成功。使用简单的拖放API&按偏移量拖放。而且还使用了动作链,对我来说没有任何效果。我可以看到很少有ppl提到,它已经为他们工作,请有人在这里指导我 from selenium.webdriver.common.action_chains import ActionChains def test_drag_and_drop(self): source = self.find_elements("xpath=xpath_of

我正在尝试执行拖放,python webdriver。 但我并不成功。使用简单的拖放API&按偏移量拖放。而且还使用了动作链,对我来说没有任何效果。我可以看到很少有ppl提到,它已经为他们工作,请有人在这里指导我

from selenium.webdriver.common.action_chains import ActionChains

def test_drag_and_drop(self):
    source = self.find_elements("xpath=xpath_of_source")
    destination = self.find_elements("id=id_of_destination")  
    ActionChains(self).drag_and_drop(source, destination).perform()
    return(self)
获取错误:AttributeError:对象没有属性“w3c”?

Draggable部分HTML代码:
文本1
Text2也一样
Text3也一样
可拖放部分HTML代码:
来源:xpath=//div[@id='textBox']//div[contains(text(),'Text1')]
目的地:id=messagearea

我们可以多次将“Text1”拖动到可拖放区域。

您可以分享更多细节:您如何创建webdriver实例,如何在脚本中使用
测试拖动和拖放()
,以及
源代码的xpath=xpath\u
目标代码的id=id\u
在实际代码中的外观如何?@Andersson:假设上述函数在“test.py”(robot_page object),所以即使XPath和ID也存在于文件中。在我的testcase文件(filename.robot)中,我只是将此函数称为“test_drag_和_drop”。当然,我使用robot关键字打开浏览器,“open browser”。@Andersson:更新了上述所有详细信息。请使用stacktrace显示完整错误。
Draggable part HTML Code:
<div id="textBox" class="whiteBox textBox" style="height:160px;width:100%;">
    <span style="padding-top:4px;padding-bottom:4px;clear:both;float:left;" _attr="constant" _type="textName">
        <div class="simpleClass" contenteditable="false" dontcancelselect="true" onselectstart="GetBrowser().allowDrag(event, this)" draggable="true">
          Text1
        <img class="textBox_icon" contenteditable="false" src="img/text_box.gif" style="display:none">
        </div>
   </span>
   <span> same for Text2 </span>
   <span> same for Text3 </span>

Droppable part HTML Code :
<div id="messageDiv" class="contentEditableOuterContainer multiLine" style="position:relative">
    <pre id="messagearea" class="contentEditableContainer multiLine inputpre" contenteditable="true" spellcheck="false">

Source : xpath=//div[@id='textBox']//div[contains(text(),'Text1')]
Destination : id=messagearea