Durante l'esecuzione di test Selenium sul mio progetto Django, ho iniziato a ottenere l'errore:Selenio: elemento non cliccabile ... altro elemento riceverebbe Clicca
selenium.common.exceptions.WebDriverException: Message: Element is not clickable at point (61, 24.300003051757812). Other element would receive the click: <a class="navbar-brand" href="#"></a>
E 'strano per due ragioni: in primo luogo, i test sono passati in precedenza e non ho modificato quella parte del codice di base. In secondo luogo, quando si apre la finestra di Firefox basata su selenio e io massimizzo la pagina, i test passano. Ma quando lascio che i test Selenium funzionino con il browser Firefox non massimizzato, falliscono.
Non sto utilizzando alcun javascript di fantasia (solo il modello Bootstrap 3 di base), solo semplice vecchio html e css. Sto usando Django 1.9 su Python 3.4. Ho eseguito pip per verificare gli aggiornamenti a Selenium e sono aggiornato.
Here is a pastebin link per l'html dell'output della visualizzazione personale e del modello.
Uno dei test fallimento è:
def test_create_task_and_check_that_it_shows_up_in_the_task_manager_index_and_filter(self):
# Create user
self.user = User.objects.get(username=test_superuser_username)
# Log the user in
self.log_user_in(user_object=self.user, password=test_superuser_password)
self.browser.implicitly_wait(10)
# Pull up the main task manager page
self.browser.get(str(self.live_server_url) + reverse('task_manager:index'))
# Make sure we go to the task manager index
task_index_url = str(self.live_server_url) + reverse('task_manager:index')
self.browser.get(task_index_url)
self.browser.implicitly_wait(4)
self.assertTrue(str(task_index_url) == self.browser.current_url,
msg=('Assertion that current_url is %s failed. Current_url is %s' %
(str(reverse('task_manager:index')), self.browser.current_url)))
# Click the 'add task' button on the sidebar
add_task_taskbar_button = self.browser.find_element_by_name('add_task_sidebar_link')
add_task_taskbar_button.click()
L'ultima riga genera l'errore:
ERROR: test_create_task_and_check_that_it_shows_up_in_the_task_manager_index_and_filter (tasks.tests.test_functional.SeleniumTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mint/Python_Projects/[project_name]/tasks/tests/test_functional.py", line 94, in test_create_task_and_check_that_it_shows_up_in_the_task_manager_index_and_filter
add_task_taskbar_button.click()
File "/home/mint/Python_Projects/venv/lib/python3.4/site-packages/selenium/webdriver/remote/webelement.py", line 75, in click
self._execute(Command.CLICK_ELEMENT)
File "/home/mint/Python_Projects/venv/lib/python3.4/site-packages/selenium/webdriver/remote/webelement.py", line 469, in _execute
return self._parent.execute(command, params)
File "/home/mint/Python_Projects/venv/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 201, in execute
self.error_handler.check_response(response)
File "/home/mint/Python_Projects/venv/lib/python3.4/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Element is not clickable at point (61, 24.300003051757812). Other element would receive the click: <a class="navbar-brand" href="#"></a>
Fatemi sapere se il sotto va bene - upvote/contrassegno come risposta –