# How to set the header of a web-session

**URL:** <https://forum.katalon.com/t/how-to-set-the-header-of-a-web-session/41289>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [March 20, 2020, 8:03am UTC](https://forum.katalon.com/t/how-to-set-the-header-of-a-web-session/41289 "2020-03-20T08:03:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sr.heye](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sr.heye/32/7683_2.png) [@sr.heye](https://forum.katalon.com/u/sr.heye)\
**Post date:** [March 20, 2020, 8:03am UTC](https://forum.katalon.com/t/how-to-set-the-header-of-a-web-session/41289/1 "2020-03-20T08:03:03Z")

</div>

Need some help…  
I want to mock a service by setting the header properties. I found some examples for API calls but I’m using a browser session (and don’t want to use an extension).

How do I set the header of an active browser session? Or is mij approach incorrect?  
Thanks!!

Same code I’m using :

```
WebUI.openBrowser("https://my.site.nl/")

// RequestObject request = new RequestObject()
// RequestObject request = findTestObject('Object Repository/...')
RequestObject request = ?

ArrayList HTTPHeader = new ArrayList()
HTTPHeader.add(new TestObjectProperty('XXX', ConditionType.EQUALS, 'XXX'))
request.setHttpHeaderProperties(HTTPHeader)
```

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [March 20, 2020, 4:09pm UTC](https://forum.katalon.com/t/how-to-set-the-header-of-a-web-session/41289/2 "2020-03-20T16:09:40Z")

</div>

Give this a read:

> [@Modifying Headers with BrowserMob](http://forum.katalon.com/t/modifying-headers-with-browsermob/39287):
>
> Hello fellow testers! I’ve seen several topics around how to add custom header values to all request when executing WebUI tests with Katalon, so I thought I’d share the results of my labor to get this working hugs This approach only works for Chrome at the moment, but as you’ll see, it would be easy to modify for other browser types. 1.) Download the zip file from the [BrowserMob Proxy](https://bmp.lightbody.net/) website, and extract the browsermob-core-{version}-sources.jar to the Drivers folder for your project. 2.) …

---

<div class="post-metadata">

**Author:** ![ed.love](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ed.love/32/16104_2.png) [@ed.love](https://forum.katalon.com/u/ed.love)\
**Post date:** [March 2, 2022, 5:16am UTC](https://forum.katalon.com/t/how-to-set-the-header-of-a-web-session/41289/3 "2022-03-02T05:16:41Z")

</div>

Sorry, that’s WAY more complex than I can handle, being a newbie to katalon.

Surely we can just add half a dozen lines of code after WebUI.openBrowser? Or something like that?

Thanks in advance!
