3

我正在尝试在 Safari 12.0 浏览器中使用 ActionChains 创建移动到元素操作,但出现下一个错误:

selenium.common.exceptions.InvalidArgumentException: Message: Encountered key input source with invalid 'value' in payload: {
actions =     (
            {
        duration = 0;
        type = pause;
    }
);
id = key;
type = key;
}

相同的测试在任何浏览器(Firefox、Chrome、Ie、Edge 等)中都成功通过,但在 Safari 中失败。

创建此操作的源代码:

element_to_hover_over = driver.find_element_by_xpath('/html/body/div[7]/div[1]/header/div[1]/div/ul/li[1]/div[1]/span[1]')
hover = ActionChains(driver).move_to_element(element_to_hover_over)
hover.perform()
4

1 回答 1

0

#self.w3c_actions.key_action.pause()从课堂上评论这行为ActionChains我解决了问题但它是一种解决方法,需要驱动程序进行适当的修复

于 2019-02-15T06:48:26.373 回答