# validateMatch in the HTTP request

**URL:** <https://forum.katalon.com/t/validatematch-in-the-http-request/11891>\
**Category:** Miscellaneous\
**Created:** [July 5, 2018, 12:03pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891 "2018-07-05T12:03:06Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 5, 2018, 12:03pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/1 "2018-07-05T12:03:06Z")

</div>

After click on certain DOM element my page sents click events an Google Analytics. Click events are sent like GET HTTP requests / URLs like

```auto
https://stats.g.doubleclick.net/r/collect?v=1&aip=1&t=dc&_r=3&tid=UA-1234567-1&cid=297722160.1523959944&jid=2028321276&_gid=1320758195.1530624077&gjid=12698493&_v=j68&z=1135539045

```

How is this URL to inspect? I want to test some things with it:

- whether it is indeed sent?
- what status code was as an answer to request?
- whether the URL contains certain values?

As first there should be a defining of the testObject as DOM element, and click on it. But what next?

---

<div class="post-metadata">

**Author:** ![Mate\_Mrse](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mate_mrse/32/345_2.png) [@Mate\_Mrse](https://forum.katalon.com/u/Mate_Mrse)\
**Post date:** [July 5, 2018, 2:25pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/2 "2018-07-05T14:25:18Z")

</div>

Take a look at Web Services keywords:

[https://docs.katalon.com/display/KD/Web+Service](https://docs.katalon.com/display/KD/Web+Service)

---

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 5, 2018, 2:29pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/3 "2018-07-05T14:29:53Z")

</div>

> Mate Mrse said:
> 
> Take a look at Web Services keywords:

i see only the possibility to send request, not to inspect an already sent one:( Where am i wrong?

---

<div class="post-metadata">

**Author:** ![Mate\_Mrse](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mate_mrse/32/345_2.png) [@Mate\_Mrse](https://forum.katalon.com/u/Mate_Mrse)\
**Post date:** [July 5, 2018, 2:35pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/4 "2018-07-05T14:35:23Z")

</div>

You can use WS.verifyResponseStatusCode() for your second question, and WS.verifyElementText() for third (I guess).

My WS testing skills are still pretty raw so that’s all I got for now.

---

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 5, 2018, 3:02pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/5 "2018-07-05T15:02:25Z")

</div>

hmmm, i thought, both keywords are regarding HTTP response, not request…

---

<div class="post-metadata">

**Author:** ![Mate\_Mrse](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mate_mrse/32/345_2.png) [@Mate\_Mrse](https://forum.katalon.com/u/Mate_Mrse)\
**Post date:** [July 6, 2018, 6:10am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/6 "2018-07-06T06:10:28Z")

</div>

You can save the response in a variable and then examine it:

```auto
def response = WS.sendRequest(findTestObject('Your object'))

```

---

<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 6, 2018, 7:06am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/7 "2018-07-06T07:06:19Z")

</div>

Evgeniy,

I have an acquaintance with you in another post : [Finding any portion of script content - Katalon Studio - Katalon Community](http://forum.katalon.com/discussion/7728/finding-any-portion-of-script-content)

In the post I learned that **you are working on your web pages** which employ Google Tag Manager (https://www.google.com/analytics/tag-manager/ ) and Google Analytics (https://analytics.google.com/analytics/web/provision/?authuser=0#provision/SignUp/ )

I believe your intension is NOT to test if the Google Tag Manager service and the Google Analytics serivce are functioning.

However, you said you want to test

> - whether it is indeed sent?
> 
> - what status code was as an answer to request?
> 
> - whether the URL contains certain values?

I think that these concerns are for Google people, not you as a user. I wonder why you are concerned about quality of the Google products.

---

<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 6, 2018, 7:08am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/8 "2018-07-06T07:08:12Z")

</div>

Mate,

You effectively suggested how to test the Google products using Katalon Studio’s Web Services keywords. Well, … who want to do the job?

---

<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 6, 2018, 7:12am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/9 "2018-07-06T07:12:45Z")

</div>

Evgeniy,

Going back to your question,

> I want to test some things with it:
> 
> - whether it is indeed sent?

No.

What you can do using Katalon Studio WebUI keywords is to get access to the HTML Document of your Web pages exposed by a browser through [the WebDriver protocol](https://www.w3.org/TR/webdriver/). The [W3C Web Driver specification](https://www.w3.org/TR/webdriver/)does not support API through which Browsers send log events (such as a HTTP Request sent, a HTTP Response received, etc) to the WebDriver clients such as Katalon Studio. Therefore the Katalon does not support feature with which you can inspect how a browser talk to backend servers with HTTP request/response.

---

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 6, 2018, 7:46am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/10 "2018-07-06T07:46:44Z")

</div>

> kazurayam said:
> 
> these concerns are for Google people

Sorry, i missed to explain my test needs at first…

- There is (anywhere, not reachable by me) a digital analyst, who implements web analytic (GA+GTM)
- There are (anywhere, not reachable by me) developers, who make code commits, which (often) make implemented web analytics corrupt by change or disappear of DOM elements or the like.
- There is me, who should establish a test prozedure, where digital analyst is notified, if any code commit maked his analytics code corrupted.

---

<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 6, 2018, 8:04am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/11 "2018-07-06T08:04:20Z")

</div>

> web analytics corrupted by change of DOM elements

Could you describe a bit more with example code snippet?

---

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 6, 2018, 8:23am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/12 "2018-07-06T08:23:15Z")

</div>

Just a simplest thing: there was a button like click - to this element, located as id=“666” was tied a click event with certain content. After code commit id=“666” was changed to class=“666” - click event is no longer fired.  
In this setup i would like to inspect whether click event is still sent and what it contains. If i can’t recognize the click event content or the click event isn’t fired at all - i notify digital analyst: dude, your button click tracking is gone.

---

<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 7, 2018, 2:25am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/13 "2018-07-07T02:25:12Z")

</div>

If I were you, I will try the following approach.

(1) The target web app uses Google Analytics. All the access to the web app is recorded and analyzed by GA.

(2) I will develop a Test Suite in Katalon Studio for the target web app. The test will traverse the web site while clicking all of buttons which send requests to various URLs. I will try to make the test as comprehensive as possible for clicking ALL the buttons. The test cases just do clicking; will do no verifications.

(3) I will setup 2 more hosts, apart from the production, for the target web app: for example “[develop.kazurayam.com](http://develop.kazurayam.com)” and “[staging.kazurayam.com](http://staging.kazurayam.com)”. Both hosts are exposed to the internet and can communicate with GA so that I can obtain the analytics results of both hosts. I will deploy the latest development version of the target web app to the “develop” host. I will deploy the current production version to the “staging” host.

(4) I will run the Test Suite (just to click all the buttons) against both hosts.

(5) I will compare the 2 sets of GA analytics results somehow. Theoretically the two should be identical as long as you run the same Katalon test suite. If any difference found and whatever the difference is, I will talk to developers to let them look at the insident.

---

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 9, 2018, 7:54am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/14 "2018-07-09T07:54:38Z")

</div>

NIce idea:) @4280-kazurayam - i’m already a little bit further: the current setup is:  
there is a developer mirror of the site, like [stage.site.com](http://stage.site.com). On the [production.site.com](http://production.site.com) i run Google Analytics with analytic.js, on the stage i run it with analytic\_debug.js. Further i run tests with Katalon on stage and… now it is the most important part, which isn’t ready… i want to record console.log of the testing browser - analytic\_debug.js writes into console.log everything about the health of tracking. The console.log output is enough for me to say definitely “there is tracking wrong, here is it ok”.

Any idea about recording of console.log with Katalon? Or anyhow on other way? I want to have an output into a file, like one url - one file.

---

<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 9, 2018, 7:59am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/15 "2018-07-09T07:59:43Z")

</div>

Have a look at this post:

> **[Verify some Javascript errors from console browser](https://forum.katalon.com/discussion/4820/verify-some-javascript-errors-from-console-browser)**
>
> How add step to verify Javascript errors. Into browser, how check console of F12 developer tools (Chrome or Firefox) Thanks.

But you should be aware , as Russ pointed out:

> It should be noted this does not and will not work in Firefox.

According to the post [Cannot Get Console Error Logs from Firefox · Issue #330 · mozilla/geckodriver · GitHub](https://github.com/mozilla/geckodriver/issues/330)

> This won’t be fixed in a future release until the (W3C WebDriver )working group decides to add it to the specification.

---

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 9, 2018, 9:38am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/16 "2018-07-09T09:38:49Z")

</div>

Thanks @4280-kazurayam - it looks indeed very promising! However to test it i need to run tests in Chrome with installed own extension (i need to install analytics\_debug.js as an extension).

Do you have an idea how to run Katalon test on Chrome with extension installed by my own?  
(Its a kind of standalone question, which deserves its own thread, but it is in context of this thread. If we are ready with it, i would write a step-by-step walkthru - it could be interessant for somebody)

---

<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 9, 2018, 1:52pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/17 "2018-07-09T13:52:58Z")

</div>

Vinh Nguyen wrote something at 12/27/2017:

> **[Extension in the Chrome browser](http://forum.katalon.com/discussion/4438/extension-in-the-chrome-browser)**
>
> I need help in adding an extension to the chrome browser, for example "Sign Token". In the test cases the following portion of code is added:

  
It looks like what you need to know.

---

<div class="post-metadata">

**Author:** ![Evgeniy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/evgeniy/32/23869_2.png) [@Evgeniy](https://forum.katalon.com/u/Evgeniy)\
**Post date:** [July 9, 2018, 3:16pm UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/18 "2018-07-09T15:16:05Z")

</div>

Oha, thanks - lets make hands dirty

---

<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 10, 2018, 1:04am UTC](https://forum.katalon.com/t/validatematch-in-the-http-request/11891/19 "2018-07-10T01:04:44Z")

</div>

> If we are ready with it, i would write a step-by-step walkthru

You should create a new post in the Tips & Tricks category.
