# Don't want WebUI.click return StepFailedException

**URL:** <https://forum.katalon.com/t/dont-want-webui-click-return-stepfailedexception/10378>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [April 19, 2018, 3:21am UTC](https://forum.katalon.com/t/dont-want-webui-click-return-stepfailedexception/10378 "2018-04-19T03:21:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jenny\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@Jenny\_Zhou](https://forum.katalon.com/u/Jenny_Zhou)\
**Post date:** [April 19, 2018, 3:21am UTC](https://forum.katalon.com/t/dont-want-webui-click-return-stepfailedexception/10378/1 "2018-04-19T03:21:18Z")

</div>

My issue is like that:  
When I check element is clickable, the element is clickable, but when I click the element, maybe some reason, the page is loading, so at that point, when I click the element, it will fail.  
My solution is:

1. Waiting for seconds and ensure the page is loading , than check the element is clickable and then click. But this always waste time and even when the network bad, the solution will be failure
2. Writing a new function that wait until click success. It works. But I found, every time when the WebUI.click() fail, the step will fail and the suit will fail even I pass all the steps. After check, I found when WebUI.click called and if the step is fail, it will return the StepFailedException and it will mark the test case fail even the test suit failed. It’s not my purpose. I want to try more times, only one time pass, the test case will pass and the suit will pass.  
Could you help me?

---

<div class="post-metadata">

**Author:** ![Marek\_Melocik](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/marek_melocik/32/371_2.png) [@Marek\_Melocik](https://forum.katalon.com/u/Marek_Melocik)\
**Post date:** [April 19, 2018, 5:39am UTC](https://forum.katalon.com/t/dont-want-webui-click-return-stepfailedexception/10378/2 "2018-04-19T05:39:38Z")

</div>

Hi Jenny,

FailureHandling.OPTIONAL is exactly you are looking for.  
It throws only WARNING message into a log, but step is not failed anymore. Usage:

```auto
WebUI.click(findTestObject("Path/To/Object1"), FailureHandling.OPTIONAL)

```

---

<div class="post-metadata">

**Author:** ![himanshu.paliwal](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@himanshu.paliwal](https://forum.katalon.com/u/himanshu.paliwal)\
**Post date:** [July 15, 2019, 12:37pm UTC](https://forum.katalon.com/t/dont-want-webui-click-return-stepfailedexception/10378/3 "2019-07-15T12:37:51Z")

</div>

Did you got any solution?  
I have similar issue.

**try{**  
**get text from web component**  
**}**  
**catch(Exception ex)**  
**{**  
**perform some operation if step in try fails**  
**}**

Code is not going into catch block

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:43am UTC](https://forum.katalon.com/t/dont-want-webui-click-return-stepfailedexception/10378/4 "2022-08-08T07:43:23Z")

</div>

Archived on August 8, 2022, 7:43am UTC


