コード例 #1
0
def get_firefox_binary():
    """Gets the firefox binary

    @rtype: FirefoxBinary
    """
    browser_config = BrowserConfig()
    constants_config = ConstantsConfig()
    log_dir = os.path.join(constants_config.get('logs_dir'), 'firefox')
    create_directory(log_dir)

    log_path = os.path.join(log_dir, '{}_{}.log'.format(datetime.datetime.now().isoformat('_'), words.random_word()))
    log_file = open(log_path, 'w')
    log('Firefox log file: {}'.format(log_path))

    binary = FirefoxBinary(log_file=log_file)

    return binary
コード例 #2
0
def get_firefox_profile():
    # TODO: update this so that it is not browser-specific
    constants_config = ConstantsConfig()
    profile_directory = os.path.join(constants_config.get('webdriver_dir'), 'firefox', 'profile', 'tmp')
    create_directory(profile_directory)


    ffprofile = webdriver.FirefoxProfile(profile_directory)

    log_dir = os.path.join(constants_config.get('logs_dir'), 'webdriver')
    create_directory(log_dir)

    log_path = os.path.join(log_dir, '{}_{}.log'.format(datetime.datetime.now().isoformat('_'), words.random_word()))
    log('Selenium log file: {}'.format(log_path))

    # Accept firefox profiles
    ffprofile.set_preference('webdriver.log.file', log_path)
    return ffprofile
コード例 #3
0
def get_firefox_binary():
    """Gets the firefox binary

    @rtype: FirefoxBinary
    """
    browser_config = BrowserConfig()
    constants_config = ConstantsConfig()
    log_dir = os.path.join(constants_config.get('logs_dir'), 'firefox')
    create_directory(log_dir)

    log_path = os.path.join(
        log_dir, '{}_{}.log'.format(datetime.datetime.now().isoformat('_'),
                                    words.random_word()))
    log_file = open(log_path, 'w')
    log('Firefox log file: {}'.format(log_path))

    binary = FirefoxBinary(log_file=log_file)

    return binary
コード例 #4
0
def get_firefox_profile():
    # TODO: update this so that it is not browser-specific
    constants_config = ConstantsConfig()
    profile_directory = os.path.join(constants_config.get('webdriver_dir'),
                                     'firefox', 'profile', 'tmp')
    create_directory(profile_directory)

    ffprofile = webdriver.FirefoxProfile(profile_directory)

    log_dir = os.path.join(constants_config.get('logs_dir'), 'webdriver')
    create_directory(log_dir)

    log_path = os.path.join(
        log_dir, '{}_{}.log'.format(datetime.datetime.now().isoformat('_'),
                                    words.random_word()))
    log('Selenium log file: {}'.format(log_path))

    # Accept firefox profiles
    ffprofile.set_preference('webdriver.log.file', log_path)
    return ffprofile