You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ohaya <oh...@yahoo.com.INVALID> on 2022/07/18 20:46:01 UTC

How to escape characters in strings in CSV Data Set Config

Hi,

I have a test plan that uses  CSV Data Set Config to rotate through a set of request bodies (strings), but some of the bodies in the CSV files have characters like comma (","), e.g.:

<Request xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os" xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">    <Subject>        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#PrincipalInfo">            <AttributeValue>{name=cn=ImageryPolicyUser1,ou=People,ou=xxx,ou=yyy,o=ooo,c=us}+(class=weblogic.security.principal.WLSUserImpl)</AttributeValue>               </Attribute>    </Subject>    <Resource>        <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>h://z/iEval</AttributeValue> </Attribute></Resource><Action><Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"            DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>GET</AttributeValue>        </Attribute>    </Action>    <Environment>        <Attribute AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#metadata" DataType="http://www.w3.org/2001/XMLSchema#string">  <AttributeValue>{ "wac": 1000 }					            </AttributeValue>            </Attribute>    </Environment></Request>

How can I escape those characters?

Thanks,
Jim

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


Re: How to escape characters in strings in CSV Data Set Config

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 18.07.22 um 23:07 schrieb ohaya:
>   Hi,
>
> I tried replacing the "," in the CSV string with %2C, but when it sent the request body if left the %2C literally in the CSV string :(!!

I think at the moment the delimiter can be a single character only (\t 
counts as a single tab).

Felix

>
>
>
>       On Monday, July 18, 2022, 04:46:08 PM EDT, ohaya<oh...@yahoo.com>  wrote:
>   
>   Hi,
>
> I have a test plan that uses  CSV Data Set Config to rotate through a set of request bodies (strings), but some of the bodies in the CSV files have characters like comma (","), e.g.:
>
> <Request xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os" xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">    <Subject>        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#PrincipalInfo">            <AttributeValue>{name=cn=ImageryPolicyUser1,ou=People,ou=xxx,ou=yyy,o=ooo,c=us}+(class=weblogic.security.principal.WLSUserImpl)</AttributeValue>              </Attribute>    </Subject>    <Resource>        <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>h://z/iEval</AttributeValue> </Attribute></Resource><Action><Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"            DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>GET</AttributeValue>        </Attribute>    </Action>    <Environment>        <Attribute AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#metadata"  DataType="http://www.w3.org/2001/XMLSchema#string">  <AttributeValue>{ "wac": 1000 }                                </AttributeValue>            </Attribute>    </Environment></Request>
>
> How can I escape those characters?
>
> Thanks,
> Jim
>    

Re: How to escape characters in strings in CSV Data Set Config

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 19.07.22 um 01:28 schrieb ohaya:
>   Hi,
>
> I was able to get this working by change the "Delimiter" in the CSV Data Set Config to "@", which isn't occurring in any of the CSV lines.

Good to know, that this helped you.

You could also try to use quoted data. But you have to make sure, that 
quotes in the data are escaped by quotes. Say, you have a delimiter of 
',' (comma) and the values 'a,b' and 'a,"b"' (the single ticks are to 
show the boundaries of the values and are not part of the values), the 
quoted data would look like

"a,b","a,""b"""

(should work, haven't tried)

Felix

>
> Jim
>
>
>       On Monday, July 18, 2022, 05:07:56 PM EDT, ohaya<oh...@yahoo.com>  wrote:
>   
>    Hi,
>
> I tried replacing the "," in the CSV string with %2C, but when it sent the request body if left the %2C literally in the CSV string :(!!
>
>
>
>
>       On Monday, July 18, 2022, 04:46:08 PM EDT, ohaya<oh...@yahoo.com>  wrote:
>   
>   Hi,
>
> I have a test plan that uses  CSV Data Set Config to rotate through a set of request bodies (strings), but some of the bodies in the CSV files have characters like comma (","), e.g.:
>
> <Request xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os" xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">    <Subject>        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#PrincipalInfo">            <AttributeValue>{name=cn=ImageryPolicyUser1,ou=People,ou=xxx,ou=yyy,o=ooo,c=us}+(class=weblogic.security.principal.WLSUserImpl)</AttributeValue>              </Attribute>    </Subject>    <Resource>        <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>h://z/iEval</AttributeValue> </Attribute></Resource><Action><Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"            DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>GET</AttributeValue>        </Attribute>    </Action>    <Environment>        <Attribute AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#metadata"  DataType="http://www.w3.org/2001/XMLSchema#string">  <AttributeValue>{ "wac": 1000 }                                </AttributeValue>            </Attribute>    </Environment></Request>
>
> How can I escape those characters?
>
> Thanks,
> Jim
>      

Re: How to escape characters in strings in CSV Data Set Config

Posted by ohaya <oh...@yahoo.com.INVALID>.
 Hi,

I was able to get this working by change the "Delimiter" in the CSV Data Set Config to "@", which isn't occurring in any of the CSV lines.

Jim


     On Monday, July 18, 2022, 05:07:56 PM EDT, ohaya <oh...@yahoo.com> wrote:  
 
  Hi,

I tried replacing the "," in the CSV string with %2C, but when it sent the request body if left the %2C literally in the CSV string :(!!




     On Monday, July 18, 2022, 04:46:08 PM EDT, ohaya <oh...@yahoo.com> wrote:  
 
 Hi,

I have a test plan that uses  CSV Data Set Config to rotate through a set of request bodies (strings), but some of the bodies in the CSV files have characters like comma (","), e.g.:

<Request xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os" xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">    <Subject>        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#PrincipalInfo">            <AttributeValue>{name=cn=ImageryPolicyUser1,ou=People,ou=xxx,ou=yyy,o=ooo,c=us}+(class=weblogic.security.principal.WLSUserImpl)</AttributeValue>              </Attribute>    </Subject>    <Resource>        <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>h://z/iEval</AttributeValue> </Attribute></Resource><Action><Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"            DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>GET</AttributeValue>        </Attribute>    </Action>    <Environment>        <Attribute AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#metadata" DataType="http://www.w3.org/2001/XMLSchema#string">  <AttributeValue>{ "wac": 1000 }                                </AttributeValue>            </Attribute>    </Environment></Request>

How can I escape those characters?

Thanks,
Jim
    

Re: How to escape characters in strings in CSV Data Set Config

Posted by ohaya <oh...@yahoo.com.INVALID>.
 Hi,

I tried replacing the "," in the CSV string with %2C, but when it sent the request body if left the %2C literally in the CSV string :(!!




     On Monday, July 18, 2022, 04:46:08 PM EDT, ohaya <oh...@yahoo.com> wrote:  
 
 Hi,

I have a test plan that uses  CSV Data Set Config to rotate through a set of request bodies (strings), but some of the bodies in the CSV files have characters like comma (","), e.g.:

<Request xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os" xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">    <Subject>        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#PrincipalInfo">            <AttributeValue>{name=cn=ImageryPolicyUser1,ou=People,ou=xxx,ou=yyy,o=ooo,c=us}+(class=weblogic.security.principal.WLSUserImpl)</AttributeValue>              </Attribute>    </Subject>    <Resource>        <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>h://z/iEval</AttributeValue> </Attribute></Resource><Action><Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"            DataType="http://www.w3.org/2001/XMLSchema#string">            <AttributeValue>GET</AttributeValue>        </Attribute>    </Action>    <Environment>        <Attribute AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#metadata" DataType="http://www.w3.org/2001/XMLSchema#string">  <AttributeValue>{ "wac": 1000 }                                </AttributeValue>            </Attribute>    </Environment></Request>

How can I escape those characters?

Thanks,
Jim