I'm setting a series of " checkboxes
" in a lista
variable. Then I run the variable in a loop so that only a few of them are clicked. However when the checkbox is not visible on the screen, Selenium does not click and displays the error. If I scroll until the checkbox appears, I can click (without using the loop, sending the command checkbox[n].click()
one by one). When I ask if the element " is_displayed
", returns True
.
My code (which was working last week!) is:
def DistribuiProcesso():
distribuir = Select(browser.find_element_by_id('selProNov771230778800100040000000000014'))
procuradores = distribuir.options
for x in range(len(procuradores)):
for y in range(len(processosAlvo)):
if processosAlvo[y][2] in procuradores[x].text: #É onde está a informação que define se será ou não selecionado o checkbox!
processosAlvo[y][1].click() #É onde está o elemento checkbox.
executar = browser.find_element_by_id('btnExecutar') #Localizo o botão de executar a tarefa.
executar.click() #Clico no botão.
voltar = browser.find_element_by_id('btnVoltar')
voltar.click()
My question: Any way to "roll" the screen? Keys.DOWN
and time.sleep()
did not help ... or did you fix the click in any way? Before it even worked with the window minimized!