# HashMap as Global Variable

**URL:** <https://forum.katalon.com/t/hashmap-as-global-variable/18982>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [February 7, 2019, 7:50am UTC](https://forum.katalon.com/t/hashmap-as-global-variable/18982 "2019-02-07T07:50:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Drunda\_Nibel](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@Drunda\_Nibel](https://forum.katalon.com/u/Drunda_Nibel)\
**Post date:** [February 7, 2019, 8:06am UTC](https://forum.katalon.com/t/hashmap-as-global-variable/18982/2 "2019-02-07T08:06:01Z")

</div>

Look at this post and the Custom Keyword addGlobalVariable() and its use in the pandemic function there to get the idea of how to create global variables of any typing at runtime:

> [@How to Highlight Test object in each and every step](http://forum.katalon.com/t/how-to-highlight-test-object-in-each-and-every-step/17408/36):
>
> I have now rewritten my error handling so that hopefully the whole class can be used immediately in any testing project as it is. The only condition should be that the global variable tcExceptionEvents is not needed elsewhere in the Katalon project. But if it is, it can of course also be renamed at every appearance in this class. If the variable does not yet exist, it will be created at runtime and, in any case, will then be filled again and again with a new Map, so that it always contains all c…

---

_[View the full topic](https://forum.katalon.com/t/hashmap-as-global-variable/18982)._
