How to get console logs of Internet Explorer browser using python selenium

I am writing a test automation suite for an HTML5 web application using python selenium and internet explorer. How to get internet explorer browser console logs using python sedan. I was able to get console logs for the same app on google chrome. I used the following code snippets

chromedriver="C:\Python27\chromedriver.exe"
os.environ["webdriver.chrome.driver"]=chromedriver
# enable browser logging
d = DesiredCapabilities.CHROME 
d['loggingPrefs'] = { 'browser':'ALL' }
driver=webdriver.Chrome(executable_path=chromedriver,desired_capabilities=d)


# test specific code in python selenium


# printing the chrome browser specific logs on console
for entry in driver.get_log('browser'):
    for key,val in entry.items() :
        if key == "message" :
            print val 

      

In the above code, "print val" will print the historical browser logs to the console. But the same code doesn't work for Internet Explorer

I am replacing the chrome information with the Internet Explorer specific information]

Iedriver="C:\Python27\IEDriverServer.exe"
os.environ["webdriver.Ie.driver"]=  Iedriver
# enable browser logging
d = DesiredCapabilities.INTERNETEXPLORER
d['loggingPrefs'] = { 'browser':'ALL' }
driver=webdriver.Ie(Iedriver,d)

      

But I cannot get the browser specific logs. Can anyone help me with this? How to get the browser console of any application in Internet Explorer using python selenium?

+3


source to share


1 answer


The Internet Explorer driver does not support extracting any type of log. Opportunities are ignored, and language-bound calls to wired JSON logging endpoints will return error responses. The SPI protocol is undefined and there was very little thought in its design. It is being reviewed and revised as part of the W3C specification effort. After the redesign is done, I would expect the IE driver to be supported at that time.



+3


source







All Articles