Qaf: StepNotFoundException is thrown even when step is implemented

Created on 18 Sep 2019  ·  8Comments  ·  Source: qmetry/qaf

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
  • [x] Eclipse
help wanted

Most helpful comment

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.

All 8 comments

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.

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){
}

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.

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.

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

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

@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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BChitrakannan picture BChitrakannan  ·  9Comments

APrem picture APrem  ·  7Comments

cjayswal picture cjayswal  ·  17Comments

Rupak-66 picture Rupak-66  ·  12Comments

Nandesh7 picture Nandesh7  ·  8Comments