You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by gchaudhari <ch...@yahoo.co.in> on 2008/03/18 13:23:12 UTC

Regular Expression for ViewState

Hi,

Can anybody please help me generate a regular expression for a ViewState
value which is dynamically generated.

An example of viewstate value is as follows:
rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVfaWQ0NXB0ABsvcGFnZXMvcHJvdGVjdGVkL21haW4ueGh0bWw=

Please help. Thanks in advance.

-Geeta
-- 
View this message in context: http://www.nabble.com/Regular-Expression-for-ViewState-tp16119617p16119617.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Regular Expression for ViewState

Posted by gchaudhari <ch...@yahoo.co.in>.
Hey, Thank you so much...
It worked.

-Geeta


Ronan Klyne-2 wrote:
> 
> gchaudhari wrote:
>> 
>> 
>> sebb-2-2 wrote:
>>> On 18/03/2008, gchaudhari <ch...@yahoo.co.in> wrote:
>>>>  Hi,
>>>>
>>>>  Can anybody please help me generate a regular expression for a
>>>> ViewState
>>>>  value which is dynamically generated.
>>>>
>>>>  An example of viewstate value is as follows:
>>>>
>>>> rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVfaWQ0NXB0ABsvcGFnZXMvcHJvdGVjdGVkL21haW4ueGh0bWw=
>>>>
>>> More information is needed, otherwise the RE may match other items.
>>>
>>> For example:
>>>
>>> .+
>>>
>>> would match, but it will match almost anything.
>>>
>>> \w+=
>>>
>>> would work, but again it may match too much.
>>>
>>> Is the value always the same length? Or does it vary, if so what are
>>> the upper and lower bounds.?
>>>
>>> The value is 112 characters.
>>>
>>> Is it always alphanumeric, or can it contain other characters?
>>> Yes, it is always alphanumeric
>>>
>>> Is the "=" part of the value?
>>> The '=' may/may not be a part of the viewstate value.
>>>
>>> What is the context in which it appears, i.e. what immediately
>>> surrounds the value?
>>> Can the surrounding text appear anywhere else, or is it unique?
>>>
>>> The surrounding is as follows - 
>>> <input type="hidden" name="javax.faces.ViewState"
>>> id="javax.faces.ViewState"
>>> value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAZfaWQxMDVwdAAbL3BhZ2VzL3Byb3RlY3RlZC9tYWluLnhodG1s"
>>> /></form>
>>>   </div>
>>>
> 
> So try a Regex like:
> <input\s+type="hidden"\s+name="javax.faces.ViewState"\s+id="javax.faces.ViewState"\s+value="([^"]+)"
> 
> Then set your template to $1$
> 
> 	# r
> 
> -- 
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 01189 028518
> ronan.klyne@groupbc.com
> www.groupbc.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Regular-Expression-for-ViewState-tp16119617p16120744.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Regular Expression for ViewState

Posted by Ronan Klyne <ro...@groupbc.com>.
gchaudhari wrote:
> 
> 
> sebb-2-2 wrote:
>> On 18/03/2008, gchaudhari <ch...@yahoo.co.in> wrote:
>>>  Hi,
>>>
>>>  Can anybody please help me generate a regular expression for a ViewState
>>>  value which is dynamically generated.
>>>
>>>  An example of viewstate value is as follows:
>>>
>>> rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVfaWQ0NXB0ABsvcGFnZXMvcHJvdGVjdGVkL21haW4ueGh0bWw=
>>>
>> More information is needed, otherwise the RE may match other items.
>>
>> For example:
>>
>> .+
>>
>> would match, but it will match almost anything.
>>
>> \w+=
>>
>> would work, but again it may match too much.
>>
>> Is the value always the same length? Or does it vary, if so what are
>> the upper and lower bounds.?
>>
>> The value is 112 characters.
>>
>> Is it always alphanumeric, or can it contain other characters?
>> Yes, it is always alphanumeric
>>
>> Is the "=" part of the value?
>> The '=' may/may not be a part of the viewstate value.
>>
>> What is the context in which it appears, i.e. what immediately
>> surrounds the value?
>> Can the surrounding text appear anywhere else, or is it unique?
>>
>> The surrounding is as follows - 
>> <input type="hidden" name="javax.faces.ViewState"
>> id="javax.faces.ViewState"
>> value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAZfaWQxMDVwdAAbL3BhZ2VzL3Byb3RlY3RlZC9tYWluLnhodG1s"
>> /></form>
>>   </div>
>>

So try a Regex like:
<input\s+type="hidden"\s+name="javax.faces.ViewState"\s+id="javax.faces.ViewState"\s+value="([^"]+)"

Then set your template to $1$

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Regular Expression for ViewState

Posted by gchaudhari <ch...@yahoo.co.in>.


sebb-2-2 wrote:
> 
> On 18/03/2008, gchaudhari <ch...@yahoo.co.in> wrote:
>>
>>  Hi,
>>
>>  Can anybody please help me generate a regular expression for a ViewState
>>  value which is dynamically generated.
>>
>>  An example of viewstate value is as follows:
>> 
>> rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVfaWQ0NXB0ABsvcGFnZXMvcHJvdGVjdGVkL21haW4ueGh0bWw=
>>
> 
> More information is needed, otherwise the RE may match other items.
> 
> For example:
> 
> .+
> 
> would match, but it will match almost anything.
> 
> \w+=
> 
> would work, but again it may match too much.
> 
> Is the value always the same length? Or does it vary, if so what are
> the upper and lower bounds.?
> 
> The value is 112 characters.
> 
> Is it always alphanumeric, or can it contain other characters?
> Yes, it is always alphanumeric
> 
> Is the "=" part of the value?
> The '=' may/may not be a part of the viewstate value.
> 
> What is the context in which it appears, i.e. what immediately
> surrounds the value?
> Can the surrounding text appear anywhere else, or is it unique?
> 
> The surrounding is as follows - 
> <input type="hidden" name="javax.faces.ViewState"
> id="javax.faces.ViewState"
> value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAZfaWQxMDVwdAAbL3BhZ2VzL3Byb3RlY3RlZC9tYWluLnhodG1s"
> /></form>
>   </div>
> 
>>  Please help. Thanks in advance.
>>
>>  -Geeta
>>
>> --
>>  View this message in context:
>> http://www.nabble.com/Regular-Expression-for-ViewState-tp16119617p16119617.html
>>  Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Regular-Expression-for-ViewState-tp16119617p16120586.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Regular Expression for ViewState

Posted by sebb <se...@gmail.com>.
On 18/03/2008, gchaudhari <ch...@yahoo.co.in> wrote:
>
>  Hi,
>
>  Can anybody please help me generate a regular expression for a ViewState
>  value which is dynamically generated.
>
>  An example of viewstate value is as follows:
>  rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVfaWQ0NXB0ABsvcGFnZXMvcHJvdGVjdGVkL21haW4ueGh0bWw=
>

More information is needed, otherwise the RE may match other items.

For example:

.+

would match, but it will match almost anything.

\w+=

would work, but again it may match too much.

Is the value always the same length? Or does it vary, if so what are
the upper and lower bounds.?

Is it always alphanumeric, or can it contain other characters?

Is the "=" part of the value?

What is the context in which it appears, i.e. what immediately
surrounds the value?
Can the surrounding text appear anywhere else, or is it unique?

>  Please help. Thanks in advance.
>
>  -Geeta
>
> --
>  View this message in context: http://www.nabble.com/Regular-Expression-for-ViewState-tp16119617p16119617.html
>  Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org