{"id":754,"date":"2019-07-02T10:25:09","date_gmt":"2019-07-02T10:25:09","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=754"},"modified":"2019-07-02T10:51:24","modified_gmt":"2019-07-02T10:51:24","slug":"load-testing-using-selenium-with-jmeter","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/","title":{"rendered":"Load Testing using Selenium with Jmeter"},"content":{"rendered":"<p><strong>Load Testing:<\/strong> Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions. It is a type of performance testing which determines software performance by simulating under real-life loads conditions. This type of testing is typically performed when a software development project is near to complete. Load testing is intended to test the website\/application by constantly and steadily increasing the load on the application until it reaches the threshold limit.<\/p>\n<p><strong>Requirements for Load testing:<\/strong><\/p>\n<ol>\n<li>Java<\/li>\n<li>Eclipse: To create a selenium project.<\/li>\n<li>Selenium jar(https:\/\/www.seleniumhq.org\/download\/), Chrome Browser jar(https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/), and JUnit jar(http:\/\/www.java2s.com\/Code\/Jar\/j\/Downloadjunit4431jar.htm) file.<\/li>\n<li>Jmeter: To perform load testing of the selenium script.<\/li>\n<\/ol>\n<p><strong>Steps to Perform Load Testing using Selenium with Jmeter:<\/strong><\/p>\n<ol>\n<li>Create a new project using the selenium in the &#8220;Eclipse&#8221;.<\/li>\n<li>Add required jar files in the project.<\/li>\n<li>Create a new class and write a script using the JUnit annotation.\n<p><strong>Code:<\/strong><\/p>\n<pre>\r\npackage LoadTesting;\r\nimport org.junit.After;\r\nimport org.junit.Before;\r\nimport org.junit.Test;\r\nimport org.openqa.selenium.WebDriver;\r\nimport org.openqa.selenium.chrome.ChromeDriver;\r\n\r\npublic class LoadTest \r\n{\r\n   static WebDriver driver;\r\n\r\n   @Before\r\n   public void before()\r\n   {\t\t\t\r\n                        System.setProperty(\"webdriver.chrome.driver\",\"C:\/chromedriver.exe\");\r\n\t\t\tdriver = new ChromeDriver();\r\n\t\t\tdriver.manage().window().maximize();\r\n\t\t\tdriver.manage().deleteAllCookies();\r\n\t\t\tSystem.out.println(\"Open the browser\");\r\n   }\r\n\t\t\r\n\r\n\r\n   @Test\r\n   public void test()\r\n   {\r\n\t  \t\tSystem.out.println(\"Navigate to the URL\");\r\n\t\t\tdriver.get(\"https:\/\/webnersolutions.com\/\");\r\n   }\r\n\t\t\r\n   @After\r\n   public void after()\r\n   {\r\n\t\t\tSystem.out.println(\"Close the browser\");\r\n\t\t\tdriver.close();\r\n   }\r\n}\r\n<\/pre>\n<p>In this example, we are navigated to the website (https:\/\/webnersolutions.com\/)URL.\n<\/li>\n<\/ol>\n<p>4. Export script class into the JAR file and save jar file into the system:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/load-testing-1.jpg\"\/><\/p>\n<p>5. Move the script jar file into the JMeter library folder location:<br \/>\n\u201cC:\\Users\\Downloads\\apache-jmeter-5.1.1\\apache-jmeter-5.1.1\\lib\\junit\u201d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/load-testing-2.jpg\"\/><\/p>\n<p>6. Add JUnit and <a href=\"https:\/\/www.studysection.com\/selenium-ide-foundation\" style=\"color:blue\">Selenium<\/a> extracted jar file with Jmeter library folder.<br \/>\n\u201cC:\\Users\\Downloads\\apache-jmeter-5.1.1\\apache-jmeter-5.1.1\\lib\u201d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/load-testing-3.jpg\"\/><\/p>\n<p>7. Now launch JMeter and create a Thread Group for performing load testing.<br \/>\na. Add a new &#8220;Test Plan&#8221;.<\/p>\n<p>b.Create a new &#8220;Thread Group(Thread Groups is a collection of Threads. Each thread represents one user using the application )&#8221;.<br \/>\nAdd >> Threads >> Thread Group.<\/p>\n<p>c. Add JUnit Request from &#8220;Sampler&#8221;.<br \/>\nAdd >> Sampler >> JUnit Request. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/load-testing-4.jpg\"\/><\/p>\n<p>d. Click on the &#8220;Search for JUnit 4 annotation&#8221; then check the &#8220;ClassName and Test Method&#8221;. It will fetch your created jar file and displayed in the ClassName.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/load-testing-5.jpg\"\/><\/p>\n<p>e. Add any listener to check the result in the Group.<br \/>\nAdd >> Listener >> View Result Tree.<\/p>\n<p><strong>Now Run the script and check the result:<\/strong><\/p>\n<p>I am running my script with Number of Threads(User): 5<br \/>\nAnd Ramp up period(in seconds):30<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/load-testing-6.jpg\"\/><\/p>\n<p>We can check the result two times script is failed out of 5 times.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Load Testing: Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions.<\/p>\n","protected":false},"author":1,"featured_media":764,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[125,123,124,22],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SS Blog - Load Testing using Selenium with Jmeter<\/title>\n<meta name=\"description\" content=\"Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SS Blog - Load Testing using Selenium with Jmeter\" \/>\n<meta property=\"og:description\" content=\"Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-02T10:25:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-02T10:51:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/selenium-jmeter-blog.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"160\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"Load Testing using Selenium with Jmeter\",\"datePublished\":\"2019-07-02T10:25:09+00:00\",\"dateModified\":\"2019-07-02T10:51:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/\"},\"wordCount\":372,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"jmeter\",\"load\",\"selenium\",\"testing\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/\",\"url\":\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/\",\"name\":\"SS Blog - Load Testing using Selenium with Jmeter\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2019-07-02T10:25:09+00:00\",\"dateModified\":\"2019-07-02T10:51:24+00:00\",\"description\":\"Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Load Testing using Selenium with Jmeter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SS Blog - Load Testing using Selenium with Jmeter","description":"Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/","og_locale":"en_US","og_type":"article","og_title":"SS Blog - Load Testing using Selenium with Jmeter","og_description":"Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions.","og_url":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2019-07-02T10:25:09+00:00","article_modified_time":"2019-07-02T10:51:24+00:00","og_image":[{"width":300,"height":160,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/07\/selenium-jmeter-blog.png","type":"image\/png"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"Load Testing using Selenium with Jmeter","datePublished":"2019-07-02T10:25:09+00:00","dateModified":"2019-07-02T10:51:24+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/"},"wordCount":372,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["jmeter","load","selenium","testing"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/","url":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/","name":"SS Blog - Load Testing using Selenium with Jmeter","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2019-07-02T10:25:09+00:00","dateModified":"2019-07-02T10:51:24+00:00","description":"Load testing is a software testing technique to test the behaviour of the website\/application under different load conditions.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/load-testing-using-selenium-with-jmeter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Load Testing using Selenium with Jmeter"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":1172,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/754"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=754"}],"version-history":[{"count":11,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/754\/revisions"}],"predecessor-version":[{"id":772,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/754\/revisions\/772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/764"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}