0
votes

I have integrated testNG with cucumber for BrowserStack automation and I want to set the capabilities to the browser before initializing it. So when I'm passing capabilities as a parameter through testing.xml file to @before method, I'm getting below error-

*io.cucumber.java.InvalidMethodSignatureException: A method annotated with Before, After, BeforeStep or AfterStep must have one of these signatures:

  • public void before_or_after(io.cucumber.java.Scenario scenario)
  • public void before_or_after()*

Scenario- I want to test multiple devices (Android, macOS) so I'm passing capabilities for each and every device from the testNG.xml file to @before setup method in my BDD cucumber framework.

Kindly check this and suggest what can be done. or suggest any better approach for the same.

1

1 Answers

0
votes

You can refer to the sample repo: https://github.com/browserstack/cucumber-java-browserstack for running tests on multiple devices.