svenkatreddy / puppeteer-loadtest

load test puppeteer (Headless Chrome API) script using node
Apache License 2.0
117 stars 21 forks source link

Different configuration for each concurrent execution #1

Closed sime closed 6 years ago

sime commented 6 years ago

Hi!

I'm looking at this tool for the first time today interested in extending it to support a different configuration for each concurrent execution.

e.g. Emulate 50 different users logging in a web application at the same time.

Obviously a configuration of these 50 different credentials would need to exist. Do you have any tips on how to approach this?

svenkatreddy commented 6 years ago

@sime let me look into this.

svenkatreddy commented 6 years ago

@sime You can put your usernames and passwords in a separate json file. your program will read from the file, get username and password. everytime it reads it will delete it from json file. you can try a package like this https://www.npmjs.com/package/lockfile when you create browser instance on puppeteer, every instance has its own session. let me know if that works for you

sime commented 6 years ago

I believe I understand what you are suggesting, but it may get a little chaotic with 50 invocations try to read/write from the same file.

But I guess the lockfile might help preventing that.