Selenium + Python无法单击元素。导航栏覆盖元素

时间:2016-09-14 07:48:37

标签: python selenium pytest

我正在使用selenium来测试我的网页的UI。 我正在使用py.test。 这是我的代码:

def test_author_create_typehead(selenium, small_app):
    selenium.get(os.environ['SERVER_NAME'] + '/submit/author/create')
    institution = selenium.find_element_by_id('institution_history-0-name')
    institution.send_keys('cer')
    selenium.find_element_by_css_selector("div.tt-suggestion").click()
    assert 'CERN' in institution

无论如何,这一行似乎都有效,但是这行引发了一个错误:

Element is not clickable at point (409.5, 33.600006103515625). 
Other element would receive the click: <a href="" id="tools-dropdown"
class="dropdown-toggle" type="button" data-toggle="dropdown" 
aria-haspopup="true" aria-expanded="true"></a>

这是selenium报告的屏幕:

Detail

如您所见,导航栏覆盖了我要点击的元素。你对如何解决这个问题有任何想法吗?或者,如果有办法用python滚动页面。

提前致谢!

0 个答案:

没有答案
相关问题