1

What is the easiest way to get chrome console js errors with Selenium python

This is what i am using but I am not able to get full error message

results = (self.driver.get_log('browser'))
print results
Mohit Sharma
  • 187
  • 1
  • 13
protea
  • 23
  • 1
  • 6

2 Answers2

2

Here is working:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

dc = DesiredCapabilities.CHROME
dc['goog:loggingPrefs'] = { 'browser':'ALL' }

driver = webdriver.Chrome(desired_capabilities=dc)
driver.implicitly_wait(30)

for entry in driver.get_log('browser'):
    print(entry)
 
driver.quit()
Mahsum Akbas
  • 1,523
  • 3
  • 21
  • 38
0

Maybe this will help? Looks like you need to pass on the desired capabilities before getting the log.

Community
  • 1
  • 1
Roberto Soares
  • 244
  • 1
  • 11