I am trying to read the console output of a webpage, especially I need the POST-GET-PUT ajax calls, with RF and Selenium. I have found some help online but I cannot seem to make it work. the python script I have is:
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
def get_logs2(driver):
# enable browser logging
#d = DesiredCapabilities.CHROME
#d['goog:loggingPrefs'] = { 'browser':'ALL' }
#driver = webdriver.Chrome(desired_capabilities=d)
# load the desired webpage
#driver.get(driver.current_url)
a = driver.get_log('browser')
# print messages
for entry in driver.get_log('browser'):
print(entry)
print("finished")
return a
I call this script from RF, after having done some operations on the webpage. So I need to pass to this function the page exactly how it is after the actions I took. To do that I do:
${seleniumlib}= Get Library Instance SeleniumLibrary
Log ${seleniumlib._drivers.active_drivers}[0]
${message} = Get Logs2 ${seleniumlib._drivers.active_drivers}[0]
I get as a result and empty message, but I know console is not empty. Can you help? Thanks.