0 votes
1 view
in Devops and Agile by (25k points)
edited by

I am struggling to get our integration tests back up and running after updating our heavily outdated FirefoxPortable to the newest version 68.0.1. I was understood to use the geckodriver. But I keep getting the following message.

Error:

org.openqa.selenium.SessionNotCreatedException(Unable to find a matching set of capabilities

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'

System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_171'

Driver info: driver.version: FirefoxDriver

Code:

 if (OS.isFamilyWindows()) {

        FirefoxBinary binary =

                new FirefoxBinary(new File(binPath + "/firefoxWindows/FirefoxPortable.exe"));

        FirefoxOptions firefoxOptions = new FirefoxOptions();

        firefoxOptions.setCapability("marionette", true);

        System.setProperty("webdriver.gecko.driver", binPath + "/geckoWindows/geckodriver.exe");

        firefoxOptions.setBinary(binary);

        ffDriver = new FirefoxDriver(firefoxOptions);

    }

Our integration tests will be executed on a shared Linux Jenkins test server. For now, I am using Windows. I would like to keep using a portable version of Firefox to prevent conflicts with other teams using the same machine. Also, the installation of Docker is, unfortunately, no option. We are using Java.version: '1.8.0_171' and we are too late in the release to switch to a later version. Should I switch to Chrome? I am in need of a quick solution, thanks.

1 Answer

0 votes
by (63.3k points)

Try to use FirefoxPortable without setting up FirefoxProfile.

 final FirefoxBinary firefoxBinary = new FirefoxBinary(new File(config.getFf_path()));

            DesiredCapabilities capabilities = DesiredCapabilities.firefox();

            capabilities.setCapability(FirefoxDriver.BINARY, firefoxBinary);

            capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);

            System.setProperty("webdriver.gecko.driver", config.getGeckodriver_path());

            driver = new FirefoxDriver(capabilities);

            driver.manage().window().maximize();

            driver.get(this.url);

I hope it works for you!

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...