<commit_before>package org.jbehave.web.selenium;

import org.openqa.selenium.Platform;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.MalformedURLException;
import java.net.URL;

public class RemoteWebDriverProvider extends DelegatingWebDriverProvider {

    protected DesiredCapabilities desiredCapabilities;

    public RemoteWebDriverProvider(DesiredCapabilities desiredCapabilities) {
        this.desiredCapabilities = desiredCapabilities;
    }

    public RemoteWebDriverProvider() {
        desiredCapabilities = DesiredCapabilities.firefox();
        desiredCapabilities.setVersion("3.6.");
        desiredCapabilities.setPlatform(Platform.WINDOWS);
    }

    public void initialize() {
        try {
            delegate.set(new RemoteWebDriver(createRemoteURL(), desiredCapabilities));
        } catch (MalformedURLException e) {
            banner();
            e.printStackTrace();
            throw new UnsupportedOperationException(e);
        } catch (UnsupportedOperationException e) {<commit_msg>ensure remote webdrivers can support screen-shotting<commit_after>package org.jbehave.web.selenium;

import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.MalformedURLException;
import java.net.URL;

public class RemoteWebDriverProvider extends DelegatingWebDriverProvider {

    protected DesiredCapabilities desiredCapabilities;

    public RemoteWebDriverProvider(DesiredCapabilities desiredCapabilities) {
        this.desiredCapabilities = desiredCapabilities;
    }

    public RemoteWebDriverProvider() {
        desiredCapabilities = DesiredCapabilities.firefox();
        desiredCapabilities.setVersion("3.6.");
        desiredCapabilities.setPlatform(Platform.WINDOWS);
        desiredCapabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
    }

    public void initialize() {

        try {
            WebDriver remoteWebDriver = new RemoteWebDriver(createRemoteURL(), desiredCapabilities);
            remoteWebDriver = new Augmenter().augment(remoteWebDriver);  // allows instanceof TakesScreenshot
            delegate.set(remoteWebDriver);
        } catch (MalformedURLException e) {
            banner();
            e.printStackTrace();
            throw new UnsupportedOperationException(e);
        } catch (UnsupportedOperationException e) {
{'fraction_non_alphanumeric': 0.08058326937835764, 'fraction_numerical': 0.0015349194167306216, 'mean_word_length': 3.9847036328871894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3144078', 'n_tokens_mistral': 692, 'n_tokens_neox': 678, 'n_words': 120}