0

I've specified in my nodeconfig.json for firefox to use the default profile instead of creating a new one every time.

However, it still creates a new profile each time, as shown in line 3

1530174032396   geckodriver     INFO    geckodriver 0.20.1 (685f18325cea0a282c736e65972f95aa6db7ca48 2018-04-03)
1530174032423   geckodriver     INFO    Listening on 127.0.0.1:41007
1530174032522   mozrunner::runner       INFO    Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lharries\\AppData\\Local\\Temp\\rust_mozprofile.wIKc55QUmufr"
1530174040955   Marionette      INFO    Listening on port 2714
09:20:41.125 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
09:20:41.208 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session e22e831e-4393-43f1-9d77-b6bd894a6f32 (org.openqa.selenium.firefox.GeckoDriverService)
1530174056358   addons.productaddons    WARN    Failed downloading XML, status: 0, reason: error
1530174056771   addons.productaddons    WARN    Failed downloading via XHR, status: 0, reason: error
[Child 28464, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346

Below is my nodeConfig.JSON

I have placed "webdriver.firefox.profile":"default" in the second line after the browser details.

{
  "capabilities":
  [
    {
      "browserName": "firefox",
      "version": "60",
      "platform": "Windows 10",
      "seleniumProtocol": "WebDriver",
      "maxInstances": 8
    },
    {
      "browserName": "chrome",
      "version": "66",
      "platform": "Windows 10",
      "seleniumProtocol": "WebDriver",
      "maxInstances": 8
    },
    {
      "browserName": "internet explorer",
      "version": "11",
      "seleniumProtocol": "WebDriver",
      "maxInstances": 5
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",   
  "webdriver.firefox.profile":"default",
  "maxSession": 8,
  "port": 5555,
  "register": true,
  "registerCycle": 5000,
  "hub": "http://localhost:4444",
  "nodeStatusCheckTimeout": 5000,
  "nodePolling": 5000,
  "role": "node",
  "unregisterIfStillDownAfter": 60000,
  "downPollingLimit": 2,
  "debug": false,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {}
}

This is how I am creating my driver object, DriverConfig is a class I created to pull information from the app settings.

        ICapabilities caps = new DesiredCapabilities();

        //generic Desktop Browser config':
        if (DriverConfig.BrowserName != "")
        { ((DesiredCapabilities)caps).SetCapability("browserName", DriverConfig.BrowserName); }
        else
        { }
        if (DriverConfig.Version != "")
        { ((DesiredCapabilities)caps).SetCapability("version", DriverConfig.Version); }
        else
        { }
        if (DriverConfig.Platform != "")
        { ((DesiredCapabilities)caps).SetCapability("platform", DriverConfig.Platform); }
        else
        { }

        Instance = new RemoteWebDriver(new Uri(DriverConfig.BrowserExecutionAddress), caps);

        // Maximise the window for consistency
        Instance.Manage().Window.Maximize();

        // Go to the start URL
        Instance.Navigate().GoToUrl(DriverConfig.BrowserStartURL);

UPDATE:

I have also tried following the capabilities example https://github.com/mozilla/geckodriver#capabilities-example with no success

updated nodeConfig.json

{
  "capabilities":
  [
    {
      "browserName": "firefox",
      "version": "60",
      "platform": "Windows 10",
      "seleniumProtocol": "WebDriver",
      "maxInstances": 8,
        "alwaysMatch": {
            "moz:firefoxOptions": {
                "args": ["-profile", "C://SeleniumGrid//Profiles//1tzit6yx.Automation"]
            }
        }
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", 
  "maxSession": 8,
  "port": 5555,
  "register": true,
  "registerCycle": 5000,
  "hub": "http://localhost:4444",
  "nodeStatusCheckTimeout": 5000,
  "nodePolling": 5000,
  "role": "node",
  "unregisterIfStillDownAfter": 60000,
  "downPollingLimit": 2,
  "debug": false,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {}
}

I have tried the following ways of using the config to set up the grid

java -jar SeleniumJars/selenium-server-standalone-3.12.0.jar -role node -nodeConfig nodeconfigFF.json
java -Dwebdriver.firefox.profile=Automation -jar SeleniumJars/selenium-server-standalone-3.12.0.jar -role node -nodeConfig nodeConfigFF.json
java -Dwebdriver.firefox.profile="C://SeleniumGrid//Profiles//1tzit6yx.Automation" -jar SeleniumJars/selenium-server-standalone-3.12.0.jar -role node -nodeConfig nodeConfigFF.json

all connect and call browsers but all still create a profile in temp

LiamHarries
  • 570
  • 1
  • 5
  • 20
  • I think this was pre marionette config and wont work with marionette – Tarun Lalwani Jun 28 '18 at 09:57
  • Are you aware of how I would do it now? I'm struggling to find any clear documentation on the web. – LiamHarries Jun 28 '18 at 10:06
  • See if this helps https://github.com/mozilla/geckodriver#mozfirefoxoptions ? Use the updated ones and see if they work – Tarun Lalwani Jun 28 '18 at 10:13
  • Update the question with your code trial – undetected Selenium Jun 28 '18 at 10:16
  • @TarunLalwani that would work if I was creating a FirefoxDriver with FirefoxOptions, how I'm trying to do this with generic desired capabilities to use a RemoteWebDriver. hence focusing on trying to set it at node level in my selenium grid rather than in my tests because the tests won't know which browser they are targeting. – LiamHarries Jul 11 '18 at 08:40
  • @DebanjanB what do you mean by code trail? the first code snippet shows the output from the node and the last is the code the tests call to create a browser. all the code runs fine however the node isn't starting firefox with the correct profile – LiamHarries Jul 11 '18 at 08:44
  • @LiamHarries I did ask you for your _code trials_ on/at `Jun 28 at 10:16`. Though you updated your post on/at `Jun 28 at 11:21` you didn't update me. I will have a look shortly. – undetected Selenium Jul 11 '18 at 08:48
  • updated question with some more info on things I've been trying – LiamHarries Jul 11 '18 at 12:21

0 Answers0