Perform Performance/Load Testing Using Selenium

Author - Webner
21.04.2017
|
0 Comments
|

We can perform load testing in selenium using thread Pool Size and invocationCount attributes of Test annotation.
ThreadPoolSize will create a pool of threads with the help of which test method can be run via multiple threads.

For Example: if we want to run a test method for 15 times we can do that with following code that created 5 threads at a time (and will repeat the process 3 times to test 15 times):

import org.testng.annotations.Test;
public class ABC {
@Test(invocationCount=15, threadPoolSize=5)
public void runTest(){
System.out.println("ID of Thread is: "+Thread.currentThread().getId());
}
Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *