0

I am working on selenium with python on raspberry pi. I have installed the iceweasel version of Firefox. I am following instruction from this video.

I have a website opened using selenium and I am trying to click on a link which will open a page on the website. Normally if I do it (without selenium), it works fine. But using selenium, its taking too long to open and the loading icon on website keeps on showing. Due to this below warning message comes up in browser which the python selenium code is not able to handle and crashes.

enter image description here

Below is the code:

DASHBOARD = (By.XPATH, data["Dashboard"])  # data["Dashboard"] is getting XPATH from config file

WebDriverWait(driver, 20).until(EC.element_to_be_clickable(DASHBOARD)).click()
print("Dashboard page clicked {}")
time.sleep(20)

In the above python code, selenium is clicking on dashboard page. As soon as this thing happens, I can see it getting clicked on the website too. But after this it keeps on loading and loading and then the Unresponsive script warning comes and it shows below error:

Script: https://<url>/asse…/angular/angular.js?20190904.1:9336) The alert could not be closed. The browser may be in a wildly inconsistent state, and the alert may still be open. This is not good. If you can reliably reproduce this, please report a new issue at https://github.com/SeleniumHQ/selenium/issues with reproduction steps. Exception message: TypeError: a.document.getElementsByTagName(...)[0].getButton is not a function

I have tried using driver.implicitly_wait(5)

WebDriverWait(driver, 20).until(EC.element_to_be_clickable(DASHBOARD)).click()
print("Dashboard page clicked {}")
time.sleep(20)
driver.implicitly_wait(5)

It removes the warning but nothing much happens on the browser. The page still keeps on loading and nothing shows up.

How can I handle this behavior of the web page from python selenium. Please help. Thanks

Sid
  • 2,174
  • 1
  • 13
  • 29
S Andrew
  • 5,592
  • 27
  • 115
  • 237
  • _...The browser may be in a wildly inconsistent state, and the alert may still be open. This is not good. If you can reliably reproduce this, please report a new issue at https://github.com/SeleniumHQ/selenium/issues with reproduction steps...._ – undetected Selenium Sep 16 '19 at 11:58
  • https://stackoverflow.com/questions/18998721/selenium-unresponsive-script-error-firefox this may help . – Rahul L Sep 17 '19 at 09:50

0 Answers0