You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if we could enable browser logging without having to set it up as a remote_url and use desired capabilities.
I can hack it so the logs get generated and saved to disk, but I couldn't find a 'right' way without modifying your python code specifically to my installation.
I made this ungodly thing:
def_generic_make_browser(self, webdriver_type , desired_cap_type, remote_url, desired_caps):
'''most of the make browser functions just call this function which creates the appropriate web-driver'''ifnotremote_url:
ifwebdriver_type==webdriver.Ie:
browser=webdriver_type(log_level="INFO",log_file="my_path")
else:
browser=webdriver_type()
else:
browser=self._create_remote_web_driver(desired_cap_type,remote_url , desired_caps)
returnbrowser
Of course, I'm aware this code isn't pretty, but given the time I can spent on this my simplest solution. It'll help with debugging IE.
The closest thing to a right solution in this case would have been to implement your own keyword that creates a IE driver and puts it into the cache. This would have also been a little ugly but would not require modifying Selenium2Library.
Create Webdriver has been implemented, which allows you to control the log file and log level for IE. An example in the keyword doucmentation covers your use case. Selenium now has a get_log method to fetch the browser logs, which may be more convenient than accessing a file. There is no keyword yet exposing this functionality but you can find a workaround in this post. In order to adjust the log level, Create Webdriver would still be needed.
Activity
ombre42 commentedon Nov 22, 2013
This capability should be coming in the next release. See the debug IE driver example in the forthcoming Create Webdriver keyword.
The closest thing to a right solution in this case would have been to implement your own keyword that creates a IE driver and puts it into the cache. This would have also been a little ugly but would not require modifying Selenium2Library.
ombre42 commentedon Aug 30, 2014
Create Webdriver has been implemented, which allows you to control the log file and log level for IE. An example in the keyword doucmentation covers your use case. Selenium now has a get_log method to fetch the browser logs, which may be more convenient than accessing a file. There is no keyword yet exposing this functionality but you can find a workaround in this post. In order to adjust the log level, Create Webdriver would still be needed.
emanlove commentedon Aug 30, 2014
@ombre42: Do you see a way of adjusting the log level without having to use Create Webdriver?