Querium Testing Click-Bot

Querium Testing Clickbot

Product Genre: Custom App

Web Technology Tools:  jQuery, Chrome browser dev tools

The Team: 1 Developer, Sara

The Project: I had a few environmental constraints when making this clickbot, namely, no access to the codebase at all. Everything had to be done in console. Fortunately for me, the product was designed with Angular, and only an interior section refreshes to load the next question, rather than a new url served up via template from the back end. Lucky break for me, because that meant I had a continuous console session to work with.

See the Pen click-bot-sm by Sara Pearce (@sarapearce) on CodePen.

Next I had to consider the fact that I wanted to click in this pattern: Option A, Next Question, Option A, Next Question, etc for up to 5 questions.


Because the buttons I was clicking disappeared on the Free Response Question, I could “over click” without consequence, it would simply fire clicks with no elements.


So I wrote some click events on my elements and wrapped them with a timer so that not all click events were happening at the same time.

See the Pen click-bot by Sara Pearce (@sarapearce) on CodePen.

I never got to the level of refinement where I knew exactly how many clicks were needed  because the question set varied between 3-6 questions depending on the mathematically accuracy of the student, but there was no way to know how many were in the set with my bot, so I did not invest any time in getting the number of clicks precisely correct.


The final issue to solve was the fact that I wanted to chain the events so I could adhere to my "Option A, Next Question” pattern. I tried this by creating events that occurred as a result of a certain button click. My clicks timed poorly, and a “Continue” page would pop up after 3 correct responses, far too much variability for my timeline. So, I skipped this and went for a more of a “spray and pray” method using Javascript timeouts.


Essentially, I put click events on 3 elements, Option A, Next Question, and Continue, wrapped them in a for loop and timeout so they weren’t “spraying” exactly at the same time, though that’s as precise as I got.


And it still works. Drop it in the console, point the selectors to different buttons and you’re off to the races with your very own, “spray and pray” Console Javascript ClickBot. The code can be found here