Updated on 2024-04-25 GMT+08:00

Concatenating Strings

Function Name

$strConCat(String A, String B)

Parameter Description

  • String A: string 1.
  • String B: string 2.

Parameters A and B support the following types:

  • Strings
  • Environment parameters
  • Local parameters

Function Description

Concatenates strings 1 and 2 into a new string.

Application Scenarios

The string concatenation function can be used in the following scenarios for API automation:

  • Request URL
  • Request header
  • Request body
  • Checkpoint property
  • if condition
  • for loop interrupt condition

Example

  • Request URL

    As shown in the following figure, the value of the test parameter in the request URL is the string concatenation function. Parameters A and B in the function are abc and 123 respectively.

  • Request header

    As shown in the following figure, the value of number in the request header is the string concatenation function. Parameter A in the function is 00000, and parameter B is the environment parameter $${number}.

  • Request body

    As shown in the following figure, the string concatenation function is used in the request body. Parameter A in the function is the environment parameter $${info}, and parameter B is the environment parameter $${number}.

  • Checkpoint property

    As shown in the following figure, the target value of the checkpoint property result is the string concatenation function. Parameter A in the function is the local parameter ${str1}, and parameter B is the local parameter ${str2}.

  • if condition

    As shown in the following figure, the target value of the if condition is the string concatenation function. Parameter A in the function is abc, and parameter B is 123.

  • for loop interrupt condition

    As shown in the following figure, the target value of the for loop interrupt condition is the string concatenation function. Parameter A in the function is 0000, and parameter B is 1111.