Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in DevOps and Agile by (19.7k 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 (62.9k 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!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...