Performance testing using Jmeter and WebDriver Sampler - selenium-webdriver

I am creating a performance test suite in jmeter with webdriver sampler. I am able to do it but when I see the results(load time).It keeps changing every time I run the test for same URL (homepage). How do I get accurate results?

Performance testing using WebDriver Sampler is not what it is designed for.
As per WebDriver Sampler Tutorial
Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.
and
The Web Driver Sampler is meant to be run in conjunction with a HTTP Sampler so that from the server's perspective, the load is production like. At the same time, the web sampler will simulate the user experience of interacting with the website/webapp whilst the server is under load, hence measuring the real user's experience at the same time.
So I would recommend the following approach:
Develop your test using HTTP Request Samplers
Follow recommendations from How to make JMeter behave more like a real browser guide
Add a separate Thread Group with 1 virtual user and put WebDriver Sampler in there to measure real-life user experience during load test.

Related

How to Measure performance of an angularjs application by launching browser using Jmeter

I have measured real time page performance of an application using jmeter and selenium. Similarly, I also need to measure performance for angularJS applications by launching browser.
For functionality testing of the same angularJS application I have used Protractor, but for performance testing I couldn't able to find any tutorial related to launching browser using protractor using jmeter. can someone guide me through this.
You can use the same Selenium approach for executing tests against the Angular application, you don't have to go for Protractor. WebDriver Sampler plugin provides easy JMeter integration with Selenium, you can install WebDriver Sampler using JMeter Plugins Manager
If you already have existing set of tests relying on Protractor you can kick them off via JMeter using i.e. OS Process Sampler plugin which allows running any OS command or program in single or multi-threaded manner and measure the elapsed time.

How to performance test an Electron application?

What options do I have to performance test an Electron application in a similar way to how Load Runner does it?
I need to performance / load test an Electron application built using React. The application is deployed to Windows 7 (possibly to Windows 10 as well) and invokes ReST APIs.
I'm aware of the Spectron option but it doesn't sound like it is automated out of the box. I'd prefer to use a framework that already provides recording, playback, response time metrics, and configuring multiple scripts.
Many thanks in advance
REST means HTTP so you need a performance testing tool which supports recording HTTP traffic.
The majority of performance testing tools provide TCP or HTTP proxy server for capturing the traffic and converting it into internal form of tests
Assuming above 2 points you need to:
Choose a performance testing tool which suits your needs
Configure your Electron application to use the selected tool as a proxy, your application either has its own proxy settings or respects underlying operating system proxy setup.
This way your Electron application will communicate with the backend via performance testing tool proxy which will be capturing requests so you will be able to replay them with increased load later on. Check out How to Run Performance Tests of Desktop Applications Using JMeter for example instructions.

Can we use gatling or Jmeter to perform operations such as input text, click on element, select dropdown?

Can we perform functional-load testing using gatling or jmeter?
By Functional load testing I mean to perform certain operations on web application. User performs operations such as
Clicking on link
Entering text into a combo box (textbox + Dropdown)
Enter text into multiple textboxes
And many other operations
I want to load web app with N number of users to identify the point where the application breaks.
I have tried using Selenium Webdriver with TestNG and its invocationCount and thread-pool-size. This opens 100's of browsers which degrades the performance of the systems on which I am running the tests.
Thank you for your help in advance.
Simply you can create your tests using selenium and integrate it with Jmeter to control you load
Please find below link for how to integrate selenium with Jmeter
https://www.blazemeter.com/blog/jmeter-webdriver-sampler
I presume you are looking for a free tool to run multiple webdriver tests concurrently and at load? If so I am not aware of any free tools that can scale to hurdreds or thousands of fully headed brower sessions but there are paid tools out there. If you are interested let me know and I will share.

how to create simulator for web application for load test and stress test

how can i record the web server log files and replay the the recorded server logs so that i can latter run the logs and check the load on sql server.
ex. number of request on and the number of resposes on sql server
Build a tool that can parse the log files from the web server and replay the requests again. Then you generate test cases by accessing your site using a normal web browser and record the log files.
You can then replay the same sequence over and over again and your tool could also read multiple logs and play them back simultaneously to simulate concurrency.
Make sure that the log files include all GET and POST request parameters as well as timestamps.
Here are a couple tools that you might find useful:
Selenium is a suite of tools specifically for testing web applications.
http://seleniumhq.org/
ab (Apache HTTP server benchmarking tool) is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
http://httpd.apache.org/docs/2.0/programs/ab.html
What's wrong with using a tool? Tools like selenium will exercise the front-end, you can probably setup a server and a collection of clients running on separate machines to simulate user interaction.
If you want to exercise the backend more directly you could write a unit test I suppose, but unit testing isn't really designed for doing that sort of thing.

Performance testing using Selenium WebDriver, is it possible?

Problem Statement: I have a simple test of "Successful login to web Page". This test to be carried out with 100 different username and password. Requirement is test should hit the server with 100 usernames at the same time.
Information: Do we have to use selenium grid or RC or simple WebDriver, we are free to use any. Reading usernames & passwords from xls, or xml or parameterized junit, we are free to use whatever.
Is this possible?
How can we achieve this?
Yes, it can be done with Selenium WebDriver. If you want to reach 100 concurrent sessions, your best choice is to use an headless browser, for example PhantomJS. Here you have a running example. This example uses JUnit, Selenium WebDriver, and WebDriverManager (to handle the required binary by PhantomJS).
To fit this example into your requirements, you need to change the value of NUMBER_OF_BROWSERS to 100 and then change the code of the singleTestExcution method for your own logic (open your app and do login).
You can also do it using real browsers, e.g. Chrome (equivalent example here). But if you need to reach to 100 clients, this is going to be very expensive in terms of resources (CPU and memory) conmsuption.

Resources