본문 바로가기

성능테스트/Loadrunner

[ Loadrunner ] loadrunner의 web_add_cookie 함수

반응형

성능테스트 중 로그인 구간이 너무 느려 로그인을 제외하고 테스트를 진행할 필요가 있었다. init부분에서 초기화면, 로그인을 제거하고, Action구간에 web_add_cookie로 jsessionid와 token을 추가하려고 하는데 기존 자동으로 잡힌  web_add_cookie에 web_add_cookie (“client_id=China127B; domain=www.cnn.com”);형태로 잡혀 있어 병렬로 항목을 넣을 수 있다고 착각했는데 domain은 web_add_cookie함수의 argument였다. 실제 name=value항목은 하나씩 넣을 수 있었다. 실수를 없애고자 기록해 둔다.

 

# web_add_cookie 함수설명

int web_add_cookie( const char *Cookie);

We can see that there is an argument of type string that contains many values. Let us see the format of this argument as given below.

The Cookie parameter has the following format:

name=VALUE; (required)

 

domain=DOMAIN_NAME; (required)

expires=DATE;

path=PATH; (default path is “/”)

secure

Let us understand it with an example given below.

In the following example, the web_add_cookie function adds a cookie with the name “client_id” to the list of cookies available to the script.

web_add_cookie (“client_id=China127B; path=/; expires=Wednesday, 09–Nov–2001 23:12:40 GMT; domain=www.cnn.com”);

 

반응형