Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StepNotFoundException is thrown even when step is implemented #291

Closed
1 of 5 tasks
raviguptasmarsh opened this issue Sep 18, 2019 · 8 comments
Closed
1 of 5 tasks

Comments

@raviguptasmarsh
Copy link

QAF Version: 2.1.14

Note: only the latest version is supported

Steps To Reproduce

This is an intermittent issue and there seems to be no pattern.

Expected behavior

The step should execute.

Actual behavior

StepNotFoundException is thrown

Is the issue reproducible on runner?

  • QAS
  • Maven
  • Gradle
  • Ant
  • Eclipse
@mishalhshah
Copy link
Collaborator

can you provide more information ?
Still based on the exception there are 2 possibilities:

  1. It seems duplicate method names in java and having different BDD description. Make sure method names are different in java.
  2. Java method not exist/created which is being called from BDD.

@amitbhoraniya
Copy link
Collaborator

Hi Ravi,

First check with step.provider.pkg property, make sure it points to correct package.

If that is correct then try with providing unique stepName to your step implementation.

@QAFTestStep(description="user logins with {username} and {password}",stepName="user login with username and password")
public void login(String username,String password){
}

@raviguptasmarsh
Copy link
Author

can you provide more information ?
Still based on the exception there are 2 possibilities:

1. It seems duplicate method names in java and having different BDD description. Make sure method names are different in java.

2. Java method not exist/created which is being called from BDD.

@mishalhshah Yes, as per you pointed out. I was using different step descriptions for 2 overloaded methods. Thanks for informing about this limitation in QAF.

@raviguptasmarsh
Copy link
Author

Hi Ravi,

First check with step.provider.pkg property, make sure it points to correct package.

If that is correct then try with providing unique stepName to your step implementation.

@QAFTestStep(description="user logins with {username} and {password}",stepName="user login with username and password")
public void login(String username,String password){
}

What is the difference between "description" and "stepName" ? In our current projects, we use "description" and it works fine.

@raviguptasmarsh
Copy link
Author

@mishalhshah Same methods names in different classes can also create issue ?

@raviguptasmarsh
Copy link
Author

Thanks for the quick reply @mishalhshah @amitbhoraniya and @naeem-github

@mishalhshah
Copy link
Collaborator

@mishalhshah Same methods names in different classes can also create issue ?

@raviguptasmarsh yes same java method names without unique "StepName" in QAFTestStep will create issue.
So as suggested by @amitbhoraniya , add the unique stepName in QAFTestStep annotation or give the different java method names. let me know after applying any of the above solution works for you or not.

@amitbhoraniya
Copy link
Collaborator

stepName is a unique identifier for QAFTestStep. If stepName is not provided then QAF considers method name as a stepName.
description is used to call teststep from bdd file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants