3

I have written some tests in Selenium using NodeJs and I am looking for a way to use those tests for stress testing web apps. Is there any tool that combined with selenium can do the trick?

What I am actually looking for is a tool that is "Selenium like". Basically I want to open a webpage and execute custom javascript in the console to perform my tests. The extra part that selenium does not cover is running the test multiple simultaneous times.

5
  • 1
    Selenium is functional testing tool , you should go with Jmeter for load testing. Commented May 4, 2015 at 11:29
  • Hey @John Demetriou , you can take input data from the CSV file and parse that and you can continue with same selenium scripts
    – QAMember
    Commented May 4, 2015 at 11:30
  • @HelpingHands well I'm using selenium currently for monitoring and I would love it if there was a way to combine what I had already done with a load testing tool. Commented May 4, 2015 at 11:30
  • @sunilkumar what do you mean? Commented May 4, 2015 at 11:31
  • @JohnDemetriou - I do not think there is any way for load testing using selenium. you can but it is not recommend. Commented May 4, 2015 at 11:32

3 Answers 3

2

From what I found using Selenium Grid can help with doing a load test . I can start multiple hubs that can run the tests that I have already written in parallel. Although Selenium Grid has not been created for this particular reason. It can be used for stress testing as running multiple hubs (each hub supports up to five instances of each browser) on a server machine can do the trick

2
  • For what it's worth, here is an excerpt from the Selenium Grid FAQ: Question: Would you recommend using Selenium Grid for performance/Load testing? Answer: Selenium Grid is not designed for performance and load testing [....] For load/performance testing I would advise using tools like JMeter, Grinder or httperf.
    – user246
    Commented May 4, 2015 at 13:28
  • 2
    Yes. it is not designed for it. It's more designed to run the same test in different devices (e.g. android). But for my case it can be used as it will help me scale my functionality and monitoring tests to load testing. It is not exactly server load testing but simulating user interactions load testing Commented May 4, 2015 at 13:40
1

(You did not say how many simultaneous users you need to simulate for your stress test. My answer assumes you need to simulate more than 5 or 10.)

Using your Selenium tests as the basis for stress testing is an attractive idea. After all, they are already written/debugged. You would like to check the same things under load, so they seem relevant. And you would rather not have two different kinds of tests, using different tools/frameworks, to maintain. If one instance of a Selenium test is a functional test, couldn't one thousand instances be a stress test?

Unfortunately, there are some issues that get in the way of reusing your Selenium tests for stress testing; see for example Looking for open source, Java-based tool for performance testing. Here are two issues:

  • It is expensive. You cannot run many instances of Selenium on the same machine at the same time. In my experience, you need at least ten times as many machines using Selenium as you would with JMeter.
  • Much of the logic in your function tests is wasted on a load test. The kinds of bugs you will find running at scale will be different from what you will find in a functional test, e.g. lock contention and algorithms that do not scale well.
2
  • Yes, but with selenium I have the ease of running javascript in the console of a website. Which is part of the load tests I want to run. I did not find a way to do this with JMeter yet Commented May 4, 2015 at 12:28
  • LoadRunner can execute your JavaScript functions in a number of different ways and still maintain lightness on the resource footprint per virtual user. You may want to check out the 50 user non-charged edition. Commented May 14, 2015 at 16:06
1

Apache JMeter is designed for load testing and it provides Selenium support via WebDriver Sampler

The WebDriver Sampler uses JavaScript language for tests definition so minimal refactoring will be required and your tests should mostly work.

See The WebDriver Sampler: Your Top 10 Questions Answered guide for tips and tricks.

Alternative options are using Selenium Grid or cloud-based services like SauceLabs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.