# Check for loaded scripts on the site

**URL:** <https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [February 9, 2023, 3:44pm UTC](https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162 "2023-02-09T15:44:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolczoskar](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/wolczoskar/32/16812_2.png) [@wolczoskar](https://forum.katalon.com/u/wolczoskar)\
**Post date:** [February 9, 2023, 3:44pm UTC](https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162/1 "2023-02-09T15:44:14Z")

</div>

Hello,  
Is there an easy way to check and assert if a certain script is loaded on the site?

An example scenario:

1. User performs a certain action on the site which triggers a script to be loaded or not
2. Check for the script status according to the user action.

Manually I can check for that in the dev tools browser in the Networks tab, how can I GET those into my test case?

Sample script I want to check:

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

---

<div class="post-metadata">

**Author:** ![anon46315158](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@anon46315158](https://forum.katalon.com/u/anon46315158)\
**Post date:** [February 9, 2023, 4:27pm UTC](https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162/2 "2023-02-09T16:27:58Z")

</div>

> [@wolczoskar](#):
>
> Check for the script status according to the user action

why to do that?

IMHO, an automated test should check if the end result following a certain action was ok.  
to intermediately check if a script was loaded or not, is subject for debugging.  
not relevant for the test scope  
as a tester, you should not worry what the AUT do under the hood.  
just that the AUT do the right thing.  
for the rest, rise a bug ticket with the AUT developpers.

---

<div class="post-metadata">

**Author:** ![wolczoskar](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/wolczoskar/32/16812_2.png) [@wolczoskar](https://forum.katalon.com/u/wolczoskar)\
**Post date:** [February 9, 2023, 8:12pm UTC](https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162/3 "2023-02-09T20:12:52Z")

</div>

Basically, some tracking scripts shouldn’t be loaded if the user doesn’t agree to some cookies when first visiting a website so we want to ensure that this functionality is working as expected each time a new user visits the site, it’s vital for GDPR in the Europ.  
That’s why I would like to check that in test scenario.

---

<div class="post-metadata">

**Author:** ![anon46315158](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@anon46315158](https://forum.katalon.com/u/anon46315158)\
**Post date:** [February 10, 2023, 7:28am UTC](https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162/4 "2023-02-10T07:28:48Z")

</div>

the only thing i have into my mind now is, use mobproxy to capture the har and parse it

---

<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:** [February 10, 2023, 9:47am UTC](https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162/5 "2023-02-10T09:47:22Z")

</div>

[http://forum.katalon.com/t/sample-usage-of-browsermob-proxy-in-katalon-studio/83322](http://forum.katalon.com/t/sample-usage-of-browsermob-proxy-in-katalon-studio/83322)

---

<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:** [February 10, 2023, 9:52am UTC](https://forum.katalon.com/t/check-for-loaded-scripts-on-the-site/84162/6 "2023-02-10T09:52:01Z")

</div>

Chrome DevTools Protocol could be an alternative.

> [@How to capture network traffic and retrieve http requests info in Katalon Studio Projects.?](http://forum.katalon.com/t/how-to-capture-network-traffic-and-retrieve-http-requests-info-in-katalon-studio-projects/80687/17):
>
> You can do it if you could write a script that drivers Chrome DevTools Protocol, Network domain. A sample is here or read an article Unfortunately Katalon Studio does not provide built-in support CDP at all. But you can develop your custom Groovy code in Katalon Studio that utilizes kklisura’s lib and use CDP features.
