我在Firefox Webdriver上的move_to_element函数遇到问题(Chrome运行良好)
${SCREEN_WIDTH} 1440
${SCREEN_HEIGHT} 900
Init Firefox
Create Webdriver Firefox
Set Window Size ${SCREEN_WIDTH} ${SCREEN_HEIGHT}
Clear Input Text
[Arguments] ${locator}
${value}= Get Value ${locator}
${length}= Get Length ${value}
:FOR ${index} IN RANGE ${length}
\ Press Key ${locator} \\8
Clear Bootstrap DatePicker
[Arguments] ${locator}
Scroll Element Into View ${locator}
Clear Input Text ${locator}
Press Keys ${locator} ESC
运行此脚本后,在输出上显示:
FAIL MoveTargetOutOfBoundsException: Message: (413.8333435058594, 894.3999938964844) is out of bounds of viewport width (1440) and height (826)
我的问题出在Clear Bootstrap DatePicker
上。当我添加Scroll Element Into View ${locator}
但不起作用时,我尝试解决。
答案 0 :(得分:1)
@Import(MyConf.class)
在我的情况下不起作用。所以我实现了Scroll Element Into View
Scroll To Element