2015-09-07 127 views
0

我用下面的鼠标悬停事件无法能够让鼠标悬停点击的元素在Odoo

cash=browser.find_element_by_xpath("//Select[@name='journal_id']/option[normalize-space(text())='Cash (EUR)']") 
browser.implicitly_wait(2) 
Hover = ActionChains(browser).move_to_element(cash) 
Hover.click().build().perform() 

代码为此,我已导入库调用

from selenium.webdriver.common.action_chains import ActionChains 

但它是给出的运行时错误称为:

ERROR: test_start (__main__.Saletest) 
---------------------------------------------------------------------- 
Traceback (most recent call last): 
    File "sale_test.py", line 106, in test_start 
    Hover.click().build().perform() 
AttributeError: 'ActionChains' object has no attribute 'build' 

---------------------------------------------------------------------- 

那么是什么错误?

回答

0

不要构建 - 只能执行。替换:

Hover.click().build().perform() 

有:

Hover.click().perform() 
相关问题