While recording test cases in Katalon Studio, if I click on an element that is not actually clickable, the recorder still captures the action.
However, when I execute the test case, the execution report shows it as “Passed”, even though the click should have failed.
This causes false positives in my test results.
Has anyone faced this issue before? What solutions or best practices should I follow to handle this?
2 Likes
kindly share more info about katalon version, your AUT etc
If you were manually testing the application, you would be checking for the results of clicking this element. Does it do what is expected? The same should happen in the script - if you expect a click to advance you to the next page or to add a product to a basket, you should verify that it happens. Simply seeing a pass result against a click action is no guarantee the thing actually worked.
You have a variety of ‘verify’ keywords and assertions in Katalon that you may use to prove that your application is behaving as expected but this is sprinkled into the test script in addition to the steps you might be recording through the Recorder tool (can be done during the recording or afterwards, depending on your preference)
2 Likes
As @Dan_Bown says, you can “verify” actions that you have stated should happen have indeed happened. As an example, if the object is not clickable, you can verify that the object is not clickable.
WebUI.verifyElementNotClickable(findTestObject('…'), 10)
Additionally, you can verify what attribute is set to enable the object not to be clickable, such as “read only”.
WebUI.verifyElementAttributeValue(findTestObject('…'), "readonly", "true", 10)
You can use the Web Recorder to get a framework, but then you should come in afterwards and verify some of the efforts you want to happen.
Also, you should check what your default “FailureHandling” is set at. If it is set at STOP_AT_FAILURE, then I am really interested in your code, or object pathway, being correct. If you have an exception, or warning, like you suggest, STOP_AT_FAILURE should have caused your test case to crash. If you have it set at OPTIONAL, then I can understand your code indicating an exception, or warning, and continuing to the end of your code with a pass–nothing caused your test case to have a fatal crash. Your test case made it to the end, which is the basis of a “successful” test. You call this a “false positive”. I find it something to be investigated like maybe you have a bad pathway.
To find your FailureHandling setting, you can go to:
From Katalon Studio menu, access Project > Settings > Test Design > Test Case.
2 Likes