Undertaking load tests, I ran in a situation where I needed to use a dynamic variable (javax.faces.ViewState).

The solution is to use XPath or Regular Expressions extractors.

Both of them didn't work (...&javax.faces.ViewState=%24%7Bvar1%7D):

[![enter image description here](https://i.stack.imgur.com/AdKNI.png)](https://i.stack.imgur.com/AdKNI.png)

[![enter image description here](https://i.stack.imgur.com/IbWlh.png)](https://i.stack.imgur.com/IbWlh.png)

The value of the variables I used are 

`<input type="hidden" name="javax\.faces\.ViewState" id="javax\.faces\.ViewState" value="(.+?)"autocomplete="off" />`

and 

`//input[@id='javax.faces.ViewState']/@value`

Source: <http://se7so.blogspot.com/2012/12/apache-jmeter-along-with-jsf-pages.html>

**UPDATE1:**

The generated parameter by JSF:

[![enter image description here](https://i.stack.imgur.com/dzSNV.png)](https://i.stack.imgur.com/dzSNV.png)

**UPDATE2**

Using google chrome's console:

[![enter image description here](https://i.stack.imgur.com/PVUor.png)](https://i.stack.imgur.com/PVUor.png)

What did I miss?