アカウントメニューがあります。その上にマウスを置くと、そのサブメニューが画面に表示されます。スクリーンショットは以下の通りです。
アカウントの概要をクリックしたいのですが、私のセレンコードは次のとおりです。
def test_accounts(self):
self.login(self.driver,properties.userid,properties.password)
element_to_hover=self.driver.find_element_by_link_text('Accounts')
hover=ActionChains(self.driver).move_to_element(element_to_hover)
hover.click().perform()
self.driver.implicitly_wait(10)
self.driver.find_element_by_link_text('Account Summary').click()
次のエラーが表示されます。
test_accounts (__main__.TestCase) ... ERROR
======================================================================
ERROR: test_accounts (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\New Workspace\Python Test\src\login.py", line 78, in test_accounts
self.driver.find_element_by_link_text('Account Summary').click()
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 51, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 225, in _execute
return self._parent.execute(command, params)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 160, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 149, in check_response
raise exception_class(message, screen, stacktrace)
MoveTargetOutOfBoundsException: Message: ''
----------------------------------------------------------------------
Ran 1 test in 24.563s
FAILED (errors=1)
SO などで多くのリンクを試しましたが、問題の解決策を見つけることができませんでした。私は Selenium の初心者なので、これはリンクにマウスを合わせて非表示のサブ要素に移動する正しい方法ですか?
私はpython 2.7を使用しています。どんな助けでもいただければ幸いです