سؤال

Now I hava a requirement about Web GUI TA

I want to simulate some users(20-30) click a button at the same time and evaluate the performance of Web GUI at that time.

I use RobotFrameWork + Selenium library to do the Web Gui TA before, but as far as I know. selenium library only can handle one broswer at one time, so i dont know how to do now.

Can you give me some advice? need use another library or framework?

هل كانت مفيدة؟

المحلول 2

Selenium has a "grid" option you can use to configure many instances running many browsers.

http://www.seleniumhq.org/projects/grid/ http://www.seleniumhq.org/docs/07_selenium_grid.jsp

Grid allows you to :

scale by distributing tests on several machines ( parallel execution ) manage multiple environments from a central point, making it easy to run the tests against a vast combination of browsers / OS. minimize the maintenance time for the grid by allowing you to implement custom hooks to leverage virtual infrastructure for instance.

In short, you create a "hub" that manages things, then each "node" can perform tests as required by the hub.

Consider, however, this may not be the best route to go down. Something like multi-mechanize might be more useful: http://testutils.org/multi-mechanize/

That will allow you to have many users "clicking" the button, but not via a browser but via direct HTTP calls. That might be more suitable for multi user simultaneous "headless" load testing, which is what I think you are attempting to do.

نصائح أخرى

Like mentioned by other, what you want to do in this case is not UI testing but rather stress/load testing. You should be able to try easily Gatling. First you record the http request associated with the click on your button. Then, you write a simple scenario that launches this request 20 times at once. Something like:

setUp(scn.inject(atOnce(20 users))) .protocols(httpConf)

I'm slightly confused at this question:

Are you wanting to test the GUI? If it's something like "This button makes a dropdown menu appear", then it doesn't matter how many users do it at the same time, it'll either always work, or never work.

Are you wanting to test the server under load? If so, then Selenium will work, but there are better tools. I have used JMeter with success, but there is a really good listing of all of them here: http://performance-testing.org/

Finally, are you wanting to press 20 different buttons on the same page on the same browser at the same time? If so, this isn't possible with selenium, and it isn't a standard use case either.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top