# global variables

**URL:** <https://community.gatling.io/t/global-variables/5038>\
**Category:** Gatling (Open-Source)\
**Created:** [May 23, 2019, 1:28pm UTC](https://community.gatling.io/t/global-variables/5038 "2019-05-23T13:28:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shazad\_Dad](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@Shazad\_Dad](https://community.gatling.io/u/Shazad_Dad)\
**Post date:** [May 23, 2019, 1:28pm UTC](https://community.gatling.io/t/global-variables/5038/1 "2019-05-23T13:28:06Z")

</div>

I have a question on global variables - i have created a number of simulation and chained them together running them in the sample below

```auto
val scn = scenario("RecordedSimulation").exec(Test1.Launcher,Test2.launcher)

```

the simulation are defined as objects like:

object Test1 {

val Launcher = exec(http(“Launch Site”)

.get("/")

.headers(headers\_1)

.check(css("#\_\_VIEWSTATE",“value”).saveAs(“ViewState”)))

}

object Test 2

val Launcher = exec)http(“launch site”)

```auto
.formParam("__VIEWSTATE", "${ViewState}")

```

}

```auto
 

```

The problem i have is that im not able save the view state as a variable and use it in the second test - do you have an example of how i can do this please.
