# Verify element present does not work as expected

**URL:** <https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657>\
**Category:** Bug Report\
**Tags:** katalon-studio, bugs-report\
**Created:** [July 16, 2021, 9:34am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657 "2021-07-16T09:34:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![1968693027](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/1968693027/32/18174_2.png) [@1968693027](https://forum.katalon.com/u/1968693027)\
**Post date:** [July 16, 2021, 9:34am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/1 "2021-07-16T09:34:10Z")

</div>

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

I am using the version of 8.05 windows. I want to use verify element present to verify whether the element exists, but when the element does not exist, it will report an error. The reason is that the element does not exist, but I hope it can return false

---

<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:** [July 16, 2021, 9:52am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/2 "2021-07-16T09:52:09Z")

</div>

> [@1968693027](#):
>
> I hope it can return false

If you want the `WebUI.verifyElementPresent(TestObject,int,FailureHandling)` keyword NOT to throw Exception, then you should specify `FailureHandling.OPTIONAL` as the 3rd argument.

```auto
boolean presence = WebUI.verifyElementPresent(findTestObject(...), 20, FailureHandling.OPTIONAL)

```

---

<div class="post-metadata">

**Author:** ![1968693027](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/1968693027/32/18174_2.png) [@1968693027](https://forum.katalon.com/u/1968693027)\
**Post date:** [July 30, 2021, 4:08am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/3 "2021-07-30T04:08:23Z")

</div>

![image](https://europe1.discourse-cdn.com/katalon/original/3X/1/6/160baee532dfc1c647ec70ba3c398f4ac1dade45.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:** [July 30, 2021, 4:36am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/4 "2021-07-30T04:36:17Z")

</div>

I am not sure what you are asking to me. Do not let me guess. Please ask your question more clearly.

---

<div class="post-metadata">

**Author:** ![1968693027](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/1968693027/32/18174_2.png) [@1968693027](https://forum.katalon.com/u/1968693027)\
**Post date:** [July 30, 2021, 5:45am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/5 "2021-07-30T05:45:04Z")

</div>

I want to print the output value of verify element present, but it cannot be printed. Is the printed value true or false?

---

<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:** [July 30, 2021, 5:53am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/6 "2021-07-30T05:53:08Z")

</div>

![名称未設定](https://europe1.discourse-cdn.com/katalon/original/3X/6/e/6e935a2780303f43a09e7d2e1d3f87837f842656.png)

You used `println(...)` statement. The output from the `println` statement will be visible in the Console tab. It will not be visible in the Log Viewer tab. Please check the Console tab.

If you would like to see the output in the Log Viewer tab, you should not use `println(...)` statement. Instead you should use `WebUI.comment` keyword, like this:

```auto
//println(is_present)
WebUI.comment("is_present: " + is_present )

```

---

<div class="post-metadata">

**Author:** ![1968693027](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/1968693027/32/18174_2.png) [@1968693027](https://forum.katalon.com/u/1968693027)\
**Post date:** [July 30, 2021, 6:08am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/7 "2021-07-30T06:08:09Z")

</div>

thank you,i success

---

<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:** [July 30, 2021, 6:24am UTC](https://forum.katalon.com/t/verify-element-present-does-not-work-as-expected/56657/8 "2021-07-30T06:24:06Z")

</div>

Closed on July 30, 2021, 6:24am UTC


