api - overwrite csv file using jmeter beanshell -


i'm testing api service using oauth tokens. have divide load per api service, therefore seperated services in different thread groups (also make requests in parallel). since extracted oauth tokens (you need acces token make request api) local thread groups, used small beanshell script write tokens csv file. later on, these tokens used when doing api calls.

the problem i'm facing 'csv dataset config' element pre-loaded in memory (correct me if wrong), , because tokens arent received yet @ point api calls failing regex eof. happens few times after request succeed. implemented once controller api requests implement thinktime, helps waiting users authenticated , receive tokens.

question 1: how can read token values in realtime csv file each api call (using custom code/beanshell)?

question 2: how can make beanshell script (see below) rewrite whole csv file each time oauth2 sequence run (now keeps on appending it..) ?

situation:

enter image description here

issue fixed using 2 seperate testplans;

plan a) 1 iteration x amount of needed concurrent users generate needed tokens + write tokens csv file.

plan b) call api services divided in throughput controllers using csv dataset (oauth sequence not needed).


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -