Hi I’m a K6 rookie,
I want to know if K6 can be used in chat rooms.
Can I use K6 vus simulation many users incoming line?
Simulate real person incoming line.
ex: I want make 20 VUS and I want see these 20 VUS in my back end.
I hope in my back end can see my K6 vus incoming line and send message.
Before that, I used chrome Driver+ selenium to simulate the action of real person clicking the button to enter the chat room.
But executing multiple browsers is too taxing on my computer…
Yes, you can, assuming your chat uses HTTP or websockets? A k6 VU is an independent (parallel) JavaScript runtime, so you can simulate real users with them on the protocol (e.g. HTTP, WebSockets) level.
Before that, I used chrome Driver+ selenium to simulate the action of real person clicking the button to enter the chat room.
Can I ask you a question here?
I using xk6-browser and set like k6 load testing options = {vus:10,iterations}
But I have a problem.
My first Vus(first open browser) process success other browser will then close.
I want all browser process success than close.
Is it not supported?
or maybe I can setting where.
tks.
@Louis What specific errors are you having with more than 1 VU? Could you share your script here?
While support for it is currently experimental, from my limited testing it should work as expected. There’s currently no way to reuse a browser instance across iterations, so every VU will launch a new browser process for each iteration, but that might be desired anyway. If you run with headless: true you can avoid the browser windows popping up to make it more manageable, and running with many VUs will require a lot of system resources, but otherwise you shouldn’t run into any issues. And if you do, this might be a good starting point for us to fix it so it can eventually have better support.
Hi
I’m not sure where have specific errors
but I guess is my page load fail so page.waitForSelector can find it
(wait for selector “div[class="flex-grow-1 overflow-auto ctc-msg-layout pb-5"]> div:nth-child(1) > div:nth-child(6)> div” did not result in any nodes at reflect.methodValueCall (native))
maybe not this problem
English is not my native language.
so I didn’t explain clearly enough
I’m awfully sorry.
This is my k6 script
But website is private so I can’t support it.
@Louis, I should add that we can’t guarantee anything about running multiple browsers and VUs at this moment. However, as @imiric mentioned, it might work to some extent. The downside is that it may use a lot of system resources. Then again, it would be good to learn from your experience so we can improve the extension
@Louis If it’s a wrong selector that fails occasionally it’s difficult to help you without being able to test against your site.
Try using less specific selectors, and particularly avoid :nth-child() or immediate child (>) as that can break easily if your layout is dynamic. Instead, see if you can use just one ID or class name, which would have less chances of breaking.
Also, consider using XPath selectors, which can be more powerful than CSS selectors. They can allow you to, for example, locate an element with a class containing a name, or an element with specific inner text. E.g.: page.waitForSelector('//a[contains(@class, "common__SidebarMenuLink") and text()="Options"]').
Also, try running with headless: true. See how it’s specified here. In my tests it avoids a Cannot find context with specified id error, and it might help in your case.