Skip to content

Add IE browser loging for local browsers #248

Closed

Description

@ate-f

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'''
        if not remote_url: 
            if webdriver_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)
        return browser

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.

Activity

  1. ombre42 commented on Nov 22, 2013

    @ombre42
    Contributor

    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.

  2. ombre42 commented on Aug 30, 2014

    @ombre42
    Contributor

    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.

  3. emanlove commented on Aug 30, 2014

    @emanlove
    Member

    @ombre42: Do you see a way of adjusting the log level without having to use Create Webdriver?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions