qaf

Facing issue using QAF common step og click and clear methods


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.


Solution

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