# Unable to Find Element but Still Passing

**URL:** <https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [October 18, 2019, 11:41pm UTC](https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936 "2019-10-18T23:41:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jroman](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jroman/32/8477_2.png) [@jroman](https://forum.katalon.com/u/jroman)\
**Post date:** [October 18, 2019, 11:41pm UTC](https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936/1 "2019-10-18T23:41:33Z")

</div>

I’m able to build my test to pass finding an element that is present. I’ve purposely built it to fail and it refuses to do so.

The final step is to Verify the Element is Present with the idea that the test will fail if the element isn’t present (it’s a link containing specific text). The test passes with a line in the Log that says “Unable to find the element…”

If it can’t find the element, why is it not failing?

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [October 19, 2019, 5:11am UTC](https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936/2 "2019-10-19T05:11:04Z")

</div>

Hi @jroman

Please let me see the test case and the console log. Check under `Project > Settings > Test Design > Test Case` and paste the screenshot here.

---

<div class="post-metadata">

**Author:** ![discover.selenium](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/discover.selenium/32/522_2.png) [@discover.selenium](https://forum.katalon.com/u/discover.selenium)\
**Post date:** [October 19, 2019, 4:20pm UTC](https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936/3 "2019-10-19T16:20:23Z")

</div>

Hi @jroman Which version of Katalon are you using?

---

<div class="post-metadata">

**Author:** ![davalos](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davalos](https://forum.katalon.com/u/davalos)\
**Post date:** [October 24, 2019, 10:07pm UTC](https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936/4 "2019-10-24T22:07:38Z")

</div>

I have the same issue. If I recall correctly this would cause a “notSuchElementException”. Below screenshot shows a verifyElemntPresent on line 26 with an xpath that does not exist on the page. It does not find the element, doesn’t registers the error and continues execution.

Katalon version is 7.0.1

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/e/e4d816d4e3309f5b841731e693215168bdf81257.png)

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [October 25, 2019, 12:27am UTC](https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936/5 "2019-10-25T00:27:28Z")

</div>

Have a look at the document of the verifyElementPresent keyword:

> **[\[WebUI\] Verify Element Present](https://docs.katalon.com/katalon-studio/docs/webui-verify-element-present.html#description)**
>
> Description Verify if the given web element does present on DOM. Parameters Param Param Type Mandatory Description to TestObject Required Represent a web element. timeout int Required System will wait...

Please find there is 3rd argument `FailureHandling`. This argument is optional, defaulting to the value assigned by the UI `Project>Settings>Test Design>Test Case>Default Failure Handling for Test Step`

If you want you test case to fail and stop execution when the verifyElementPresent detected that the target Element has not come up on the view in 3 seconds, you can write:

```auto
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.model.FailureHandling as FailureHandling
...

WebUI.verifyElementPresent(findTestObject('your test object path'), 3, 
    FailureHandling.STOP_ON_FAILURE)

```

---

<div class="post-metadata">

**Author:** ![discover.selenium](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/discover.selenium/32/522_2.png) [@discover.selenium](https://forum.katalon.com/u/discover.selenium)\
**Post date:** [October 25, 2019, 10:18am UTC](https://forum.katalon.com/t/unable-to-find-element-but-still-passing/34936/6 "2019-10-25T10:18:25Z")

</div>

> [@davalos](#):
>
> Katalon version is 7.0.1

As per the release note:

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/a/a7f660792fbf98a819a394a17e0bbd99e3a822fc.png)

[https://docs.katalon.com/katalon-studio/new/version-70.html#changes-and-improvements](https://docs.katalon.com/katalon-studio/new/version-70.html#changes-and-improvements)
