4

I using TestNG to run parallel test execution on browser stack.

On Browserstack json config file I had declared all code needed .

Is it possible to pass custom name for each session when executed parallel

Here is my config file

{
  "server": "hub-cloud.browserstack.com",
  "user": "username",
  "key": "user",

  "capabilities": {
    "build": "Client Side",
    "name": "Test"
    "browserstack.debug": true
  },

  "environments": {
    "chrome": {
      "browser": "chrome"
    },
    "firefox": {
      "browser": "firefox"
    },
    "safari": {
      "browser": "safari"
    },
    "ie": {
      "browser": "internet explorer"
    }
  }
}

For each test class inside package On Browserstack Automate Dashboard it shows Test Test Test , where as I am executing all classes inside package.

Can we pass custom name for each classes inside Build.

cod
  • 133
  • 2
  • 12

2 Answers2

1

You can use beforeSession.

ex:
beforeSession: function (config, capabilities, specs) { capabilities.name = specs && specs[0].split('/').pop() || undefined; }

Ömer Faruk Aplak
  • 794
  • 2
  • 8
  • 20
0

Nunit use below :

capabilities.SetCapability("name", TestContext.CurrentContext.Test.MethodName);

before creating BrowserStack browser it is working for me, for other project checks, how we can SetCapability.

Hamed
  • 2,664
  • 3
  • 14
  • 33