# Web Driver executeJavascript exceeds timeout limit without returning result or throwing error

**URL:** <https://forum.katalon.com/t/web-driver-executejavascript-exceeds-timeout-limit-without-returning-result-or-throwing-error/180220>\
**Category:** Miscellaneous\
**Tags:** chrome-browser, web\_driver\
**Created:** [August 11, 2025, 9:21am UTC](https://forum.katalon.com/t/web-driver-executejavascript-exceeds-timeout-limit-without-returning-result-or-throwing-error/180220 "2025-08-11T09:21:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dqle](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dqle/32/30227_2.png) [@dqle](https://forum.katalon.com/u/dqle)\
**Post date:** [August 11, 2025, 9:21am UTC](https://forum.katalon.com/t/web-driver-executejavascript-exceeds-timeout-limit-without-returning-result-or-throwing-error/180220/1 "2025-08-11T09:21:51Z")

</div>

My script calls executeJavascript to find web element. If there is web element, it returns the element. Other than that, it should return null. The script should return result in under 1 second, which I verified through logging.

The issue is at a certain point in the script, executeJavascript seems to be on hold indefinitely. It didn’t return any result nor did it throw StepFailedException error. For the script timeout set to 5 seconds, the fact that the function took indefinitely to run is beyond my understanding.

The only way I could get the script to continue running was to click on the page. That seemingly triggered something under the hood that “activated” the browser, web driver, engine, etc.. I tried to simulate a user click with executeCdpCommand and Java Robot and they failed to simulate the real click.

If executeJavascript throws error, I want it to throw within the predetermined script timeout (5 seconds).

---

<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:** [August 11, 2025, 9:39am UTC](https://forum.katalon.com/t/web-driver-executejavascript-exceeds-timeout-limit-without-returning-result-or-throwing-error/180220/2 "2025-08-11T09:39:33Z")

</div>

> [@dqle](#):
>
> The issue is at a certain point in the script, executeJavascript seems to be on hold indefinitely.

Possibly the javascript code you gave to `WebUI.executeJavascript(String script, List args)` got hold indefinitely. So you should review your script code first before blaming executeJavascript.
