Reputation: 75
i need to login to a jsf page. But when i try to extract the ViewState value it doesn't work.
The ViewState input field looks like this:
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-2660902297226015539:-7257444434252784696" autocomplete="off" />
I use the XPath Extractor with the following query:
//input[@id='javax.faces.ViewState']/@value
The ViewState parameter in the Login request looks like this:
The test plan looks like this:
But when i send the POST Data looks like this:
POST data:
j_idt52=j_idt52&j_idt52%3Aj_idt53%3Aj_idt78%3AloginUsername%3AinputField=XXXXX&
j_idt52%3Aj_idt53%3Aj_idt78%3AloginPassword%3AinputSecretField=XXXXXX&
j_idt52%3Aj_idt53%3Aj_idt78%3AloginSend=Login&j_idt52%3Aj_idt53%
3Aj_idt78_active=0&javax.faces.ViewState=
It doesn't insert the ViewState.
I also tried to use the Regular Expressions Exctrator with the following expression:
<input type="hidden" name="javax\.faces\.ViewState" id="javax\.faces\.ViewState" value="(\w+?)"
Then the POST data looks like this:
POST data:
j_idt52=j_idt52&j_idt52%3Aj_idt53%3Aj_idt78%3AloginUsername%3AinputField=XXXXXX
&j_idt52%3Aj_idt53%3Aj_idt78%3AloginPassword%3AinputSecretField=XXXXXX&
j_idt52%3Aj_idt53%3Aj_idt78%3AloginSend=Login&j_idt52%3Aj_idt53%
3Aj_idt78_active=0
&javax.faces.ViewState=%24%7BViewState%7D
Encoded the parameter is:
javax.faces.ViewState=${ViewState}
Where is the problem?
Upvotes: 0
Views: 1800
Reputation: 75
I found the solution. I had to add the XPath Extractor to the HTTP Request, not like seen in the test plan screenshot.
Upvotes: 0