Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Wisdom on how to build a "stressful simulation test" with Selenium & POE

by sundialsvc4 (Abbot)
on Jul 15, 2011 at 15:56 UTC ( [id://914638]=perlquestion: print w/replies, xml ) Need Help??

sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question:

What I want to do is to construct, with Selenium, what I will call a “stressful scenario” test.   There will be, worst case, about 4,000 actors, each one pretending to be a student who is taking an online exam, all at the same time.

I have in mind to model this scenario with, say, “n” processes (on different computers), each of whom is running a Perl program that is maintaining, say, “4,000 / n” simultaneous Test::WWW::Selenium test sessions (and their associated web-browser processes, etc.).

Each “student,” according to various pseudo-random rules, “stops to think” for a random period of time, then “does something.”   Each student-simulator keeps track of whether or not they have finished the test.   (Some will not, but the test drops-dead after one hour.   We all remember that, now don’t we? ...)

So far, so good?   Well, it seems to me that a very good way to do that is with POE, because actors do spend most of their time “thinking,” and so the processing can be effectively and efficiently simulated using a timer-queue like the one that POE provides.   (Each actor is basically an individual finite-state machine.)

Bearing in mind the rule, do not do a thing already done, I’m starting my investigation now to try to find whatever existing modules might be close to, if not exactly, what I am looking for.   Suggestions and pointers are now very cordially requested by this humble penitent.

Replies are listed 'Best First'.
Re: Wisdom on how to build a "stressful simulation test" with Selenium & POE
by hardburn (Abbot) on Jul 16, 2011 at 03:51 UTC

    A while back, I experimented with a somewhat similar idea using Genetic Algorithms. I took the basic ideas from:

    http://www.sigchi.org/chi96/proceedings/papers/Kasik/djk_txt.htm

    In the end, I found that it was way to slow to generate useful test results without building a small supercomputer cluster to massively parallelize the problem. If it was just a static HTML site, you might be able to do it, but handling JavaScript greatly increases the memory requirements.


    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

      With all due respect, sir or madame ... “huh?”

        The approach is that you parse out all the possible actions on a page (links, forms, etc.), numbering them in order. The genetic part is just an array of numbers, with each entry being the number of the action to take on that page. Give it a goal to reach (like "put an item in the cart"), and pick the ones that reach that the best goal (by some measure of "best") and throw out the rest.

        I didn't get too far with some of the details (like how to handle complex forms), but it was already clear that you couldn't do it with just a moderately powerful workstation.

        It might work for stress tests rather than functional test.

        If you're unfamiliar with genetic algorithms, don't worry, they're easy. Here's a good intro: A Beginning Guide To Evolutionary Algorithms


        "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Re: Wisdom on how to build a "stressful simulation test" with Selenium & POE
by sundialsvc4 (Abbot) on Jul 15, 2011 at 21:25 UTC

    Hmmmm...   My first CPAN module?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://914638]
Approved by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found