Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Cyber Security
  3. Question
Cyber Security

I am unable to find a matching set of capabilities for the Firefox browser, what should I do?

Asked by Anil Jha Feb 23, 2022 622 views 1 answer
Share

About this question

 I'm running 2 firefox windows tests, 2 firefox mac tests, 2 chrome windows tests, and 2 chrome mac tests in parallel on both a windows node and a mac node. All tests passed except the 2 firefox mac tests. Sometimes 2 firefox mac tests will pass, but the 2 firefox windows tests would fail. Never will both 2 firefox mac tests and 2 firefox windows tests pass at the same time. I am using the latest firefox driver, latest firefox browser version, latest selenium webdriver, and latest java 8 jdk.

 testbase file

 if(browser.contains("winfirefox"))
            {
                System.setProperty("webdriver.gecko.driver", ReadProperties.globalProp.getProperty("pcgeckodriver"));
                FirefoxOptions firefoxOptions = new FirefoxOptions();
                firefoxOptions.setCapability("platform", "WINDOWS");
                firefoxOptions.setCapability("browser", "firefox");
                firefoxOptions.setCapability("newCommandTimeout", 5000);
                firefoxOptions.setCapability(FirefoxDriver.MARIONETTE, true);
                whichNodeURL=winNodeURL;    
                try
                {
                    driverThread.set(new RemoteWebDriver(new URL(whichNodeURL), firefoxOptions));
                } catch (MalformedURLException e) {
                    e.printStackTrace();
                }
            }
    else if(browser.contains("macfirefox"))
            {
                System.setProperty("webdriver.gecko.driver", ReadProperties.globalProp.getProperty("macgeckodriver"));
                FirefoxOptions macfirefoxOptions = new FirefoxOptions();
                macfirefoxOptions.setCapability("platform", "MAC");
                macfirefoxOptions.setCapability("browser", "firefox");
                macfirefoxOptions.setCapability("newCommandTimeout", 5000);
                macfirefoxOptions.setCapability(FirefoxDriver.MARIONETTE, true);
                whichNodeURL=macNodeURL;
                try
                {
                    driverThread.set(new RemoteWebDriver(new URL(whichNodeURL), macfirefoxOptions));
                } catch (MalformedURLException e) {
                    e.printStackTrace();
                }
            }
                String weburl = ReadProperties.globalProp.getProperty("weburl");
                this.driverThread.get().get(weburl);
                this.driverThread.get().manage().window().maximize(); 

    mac node json file

     {
                     "capabilities":
                       [
                {
                       "browserName": "firefox",
                       "marionette": true,
                       "maxInstances": 2,
                      "browser-version": "66.0.3",
                      "platform": "MAC",
                     "seleniumProtocol": "WebDriver"
                },
               {
                     "browserName": "chrome",
                     "maxInstances": 2,
                    "browser-version": "73.0.3683",
                    "platform": "MAC",
                    "seleniumProtocol": "WebDriver"
               },
               {
                     "browserName": "safari",
                      "technologyPreview": false,
                      "platform": "MAC",
                      "maxInstances": 1,
                     "seleniumProtocol": "WebDriver"
                    }
                 ],
              "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
              "maxSession": 2,
              "port": 5555,
              "register": true,
              "registerCycle": 5000,
              "hub": "http://xxxxxxx:4444",
             "nodeStatusCheckTimeout": 5000,
             "nodePolling": 5000,
             "role": "node",
             "cleanUpCycle": 5000,
             "timeout": 5000,
             "unregisterIfStillDownAfter": 60000,
            "downPollingLimit": 2,
            "debug": false,
            "servlets" : [],
           "withoutServlets": [],
           "custom": {}
            }
TESTNG FILE



    
        
        
    






    
        
        
    

Your answer

1 Answer

More Cyber Security discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Cyber Security Blogs

Guides, tips and career advice on Cyber Security from JanBask experts.