2

I am using Java with Selenium and TestNG. I can able to execute test parallel using TestNG.

But now I have integrated cucumber with TestNG but I can't execute cucumber scenario parallel. I can able to execute two feature file parallel using but can't execute two scenario in one feature file parallel.

Anyone have idea how we can achieve parallel execution of scenario available in one feature file?

Please find below my TestNG xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="methods" thread-count="5">
    <listeners>
        <listener class-name="com.pages.LocalWebDriverListener"></listener>
    </listeners>
    <test name="Test" parallel="methods" thread-count="5">
        <parameter name="browserName" value="firefox"></parameter>
        <classes>
            <class name="com.pages.CucumberRunner" />
        </classes>
    </test> <!-- Test -->
</suite> <!-- Suite -->

Please find below is my CucumberRunner class

@RunWith(Cucumber.class)
@CucumberOptions(features = { "scenario/test.feature" }, glue="com.pages")
public class CucumberRunner extends AbstractTestNGCucumberTests{


}

Please find below my test.feature file

Scenario: sample1
    Given Login with user account 

Scenario: sample2
    Given Login with guest account 

Scenario: sample3
    Given Login with other account 

I appreciate your help. Thanks

1 Answers1

1

Based on my research, this is not currently possible in cucumber-jvm. There is an open issue here: https://github.com/cucumber/cucumber-jvm/issues/630 to provide this capability.

Eric Reber
  • 11
  • 2