Core Step storeURLDecoded
Description
Convert URLEncoded text to it's plain ASCII equivalent and store the result into a property.
Parameters
- property
- Required? yes
- The name of the property that stores the decoded value.
- text
- Required? yes
- The text to be url decoded.
- description
- Required? no
- The description of this test step.
- propertyType
- Required? no, default is the "defaultPropertyType" as specified in the "config" element is used.
- The type of the property in which to store the retrieve value. Either "ant" or "dynamic".
Details
The inverse operation of URLDecoded is the storeURLEncoded step.
The following examples illustrate basic usage.
storeURLDecodedExamples
<webtest name="demonstrateURLDecoded">
<config .../>
<-- The default property type is set in the config settings.
In these examples, the default type is dynamic.
-->
<storeURLDecoded property="date" text="2016-02-10T00%3A00%3A00%2B00%3A00" />
<-- date="2016-02-10T00:00:00+00:00" -->
<verifyProperty description="Verify date is plain text"
name="date"
text="2016-02-10T00:00:00+00:00" />
<-- Explicitly set the property type -->
<storeURLDecoded property="point"
text="%7B%22latitude%22%3A2.98%2C%22longitude%22%3A-128.31%7D"
propertyType="ant" />
<verifyJsonPath description="Verify decoded latitude"
from="point"
jpath="$.latitude"
text="2.98" />
<verifyJsonPath description="Verify entire object is JSON"
from="point"
jpath="$..*"
text='{"latitude":2.98,"longitude":-128.31}' />
</webtest>
<config .../>
<-- The default property type is set in the config settings.
In these examples, the default type is dynamic.
-->
<storeURLDecoded property="date" text="2016-02-10T00%3A00%3A00%2B00%3A00" />
<-- date="2016-02-10T00:00:00+00:00" -->
<verifyProperty description="Verify date is plain text"
name="date"
text="2016-02-10T00:00:00+00:00" />
<-- Explicitly set the property type -->
<storeURLDecoded property="point"
text="%7B%22latitude%22%3A2.98%2C%22longitude%22%3A-128.31%7D"
propertyType="ant" />
<verifyJsonPath description="Verify decoded latitude"
from="point"
jpath="$.latitude"
text="2.98" />
<verifyJsonPath description="Verify entire object is JSON"
from="point"
jpath="$..*"
text='{"latitude":2.98,"longitude":-128.31}' />
</webtest>