The ideal process:
1. Create session
2. Initiate a request under this session
3. Verify that the results are returned
When you actually run, you will find that your project may take one more step, becoming
1. Access to Cookies
2. Create session
3. Initiate a request under this session
4. Verify that the results are returned
This note summarizes, for the method is get, the return value of the interface test JSON
First, throw an example to explain, Q1 shown
Line 1th: Get cookies
Line 2nd: Create a Request header information (you can add the desired value according to your own situation, similar to the JMeter header file, not necessarily required)
Line 3rd: Create session. Note: The API here refers to alias , which is the one specified for the currently created HTTP session. The session is recognized at the GET request.
Line 4th: Initiate the request. Return Object ${addr}
Line 5th: Determine if the request response is 200:200 to continue execution of the use case, no failure to terminate
Line 7th: Turn into JSON string format
Line 8th: Get the Count value in JSON
Line 9th: Get the data value in JSON
Line 12th: Determine if the count value is consistent with the expected value: 7. The consensus passed.
Ii. Summary of the problems I have encountered
1. Return value indicates no seesion
WORKAROUND: General Add login operation, get cookie information there is no problem. (Do not know if there are other ways to add later)
2. Return value is encoded format, want to become Chinese
FIX: Change parameter ${data} to @{data}. (Do not know if there are other ways to add later)
Robotframework Interface Test (i)-get request JSON