1

I've got a set of cucumber tests I'm running using ruby/capybara. I have the tests outputting to Browserstack but it only outputs the session ID which isn't of much use to me and want to replace with the test/scenario name.

When I try and set the scenario name using scenario.name and assigning to a variable in the before hook it does this, but only for the first run. Each test then uses the same scenario name.

I've done some investigative work and can see that the browserstack config is only initialized once at the beginning of the entire test suite run. Even if I try and initialize it each time in the before hook it doesn't run for each scenario/test.

Any help is appreciated.

1

Take a look at the following example of caps object in capabilities which I use on my tests:

{
            'automationName'=> 'Appium',
            'browserstack.appium_version' => '1.11.1',
            'project' => 'my-project-name',
            'build' => "1.5.15",
            'name' => "#{scenario.name}",
            'device' => 'Google Nexus 6',
            'real_mobile' => 'true',
            'os' => 'android',
            'os_version' =>  '6.0',
            'browserstack.debug' => true,
            'autoGrantPermissions' => true,
            'app' => 'my-app-name'
        }

The value for build groups all tests (scenarios) and you have to start a new browser on Before hooks.

Review the value you are passing to name becasue it could be the same in every execution. Ensure you are overwriting it in each execution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.