1

Facing some weird issue when using QAF common steps. We just facing in “I click” and “I clear” methods so far.

Step to reproduce: Step: And I click on "LOGIN_btn||rt.loc.e8R5BmyEUI"

@QAFTestStep(description = "I click on {0}")
public static void iClick(String locator) throws Exception {
click(locator);
}

Result: Fail

Issue: Unable to locate login button.

Here, Element locator is absolutely fine and if I change method name like “iClickOn” or “iClickABC” like below then its working fine as expected.

   @QAFTestStep(description = "I click on {0}")
    public static void iClickOn(String locator) throws Exception {
    click(locator);
    }

Result: Pass

Another approach is also working fine. If I removed “On” from step then its working fine. Step: And I click "LOGIN_btn||rt.loc.e8R5BmyEUI"

@QAFTestStep(description = "I click {0}")
public static void iClick(String locator) throws Exception {
click(locator);
}

Result: Pass Note: Same issue I'm facing in I clear locator as well. Kindly check and confirm is there any restriction to use words in steps or what could be the problem here.

Rafeek
  • 61
  • 6
  • What is `step.provider.pkg` value you have provided? The reason may be step loaded from different package. Can you share `step.provider.pkg` value you are using? – user861594 Jan 17 '22 at 07:10
  • step.provider.pkg=com.rt.steps // Note: All steps are written in the following directory: src/test/java/com/rt/steps – Renish Jan 18 '22 at 15:34
  • Yes. As Renish mentioned, we are using step.provider.pkg=com.rt.steps in applicati.properties. – Rafeek Jan 19 '22 at 08:57

1 Answers1

2

Check all entries of step.provider.pkg. Most probably the reason is you have another library specifying step with same name with same description and step loaded from it.

For example if you are using Perfecto-Quantum it has step with same name and description. The simplest way to find out is editor content-assist in IDE. You will see all available step definitions in content assist.

user861594
  • 5,733
  • 3
  • 29
  • 45