{"id":10364,"date":"2023-03-02T16:27:05","date_gmt":"2023-03-02T21:27:05","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=10364"},"modified":"2023-06-22T14:18:33","modified_gmt":"2023-06-22T18:18:33","slug":"pitfalls-of-selenium-load-testing","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/","title":{"rendered":"Pitfalls of Selenium Load Testing"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-10365\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-1.png\" alt=\"Pitfalls of Selenium Load Testing\" width=\"400\" height=\"300\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-1.png 400w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-1-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>Tests created with <a href=\"https:\/\/www.selenium.dev\/documentation\/webdriver\/\">Selenium<\/a> WebDriver replicate the user experience from the perspective of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/User_interface\">UI<\/a>.\u00a0 It can be thought of as a top-down approach whereby it accurately replicates the behavior of an end user. Running through a browser instance such as <a href=\"https:\/\/www.google.com\/chrome\/index.html\">Chrome<\/a> or <a href=\"https:\/\/www.mozilla.org\/en-US\/firefox\/new\/\">Firefox<\/a>, the test process itself interacts with the actual user interface elements of a target test application.<\/p>\n<p>This is in contrast to many other testing frameworks.\u00a0 One of the most popular is <a href=\"https:\/\/jmeter.apache.org\/usermanual\/index.html\">JMeter<\/a>, and differs from Selenium in that it takes a bottom-up approach. JMeter tests simulate the user interaction by precisely defining each individual web request in an attempt to re-create the overall user experience.<\/p>\n<h3><a id=\"post-10364-_tsbn962hjyyg\"><\/a>Advantage of Selenium for Load Testing<\/h3>\n<p>With Selenium the entire user interaction can be <a href=\"https:\/\/www.selenium.dev\/selenium-ide\/\">recorded<\/a> and replayed using a real browser window. It is therefore easy to appreciate how a Selenium test can be a superior tool for more closely simulating real user interactions with a web application. However, it does have one drawback that must be considered in the context of load testing.<\/p>\n<h3><a id=\"post-10364-_1ka5uxoc3hus\"><\/a>Disadvantage of Selenium for Load Testing<\/h3>\n<p>Selenium tests require an entire browser instance to be loaded for each virtual user simulated. This creates a very high relative resource demand when compared to each virtual user simulated with a JMeter test. While this in itself is not an absolute deal-breaker for using Selenium WebDriver for load testing, it does make it expensive. It is not uncommon for a Selenium based test to consume ten or or even one hundred times the resources per simulated virtual user as compared to a JMeter test.<\/p>\n<figure id=\"attachment_10366\" class=\"wp-caption aligncenter\" style=\"max-width: 800px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10366\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-2.png\" alt=\"Disproportionate resource requirements of a JMeter test vs a Selenium WebDriver test\" width=\"800\" height=\"600\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-2.png 800w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-2-300x225.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-2-768x576.png 768w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-2-425x319.png 425w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-caption-text\"><em>Disproportionate resource requirements of a JMeter test vs. a Selenium WebDriver test.<\/em><\/figcaption><\/figure>\n<p>As the above pictogram illustrates, two similar tests using a scripted JMeter architecture versus one using Selenium WebDriver may achieve the same task, however the scripted test is much more efficient. Given unlimited resources this wouldn\u2019t pose a problem, but most real-world scenarios involve budgetary constraints. With all else being equal, running Selenium WebDriver tests are much more expensive.<\/p>\n<h3><a id=\"post-10364-_yr8gvhyk86yt\"><\/a>Choosing the Best Architecture for Your Test<\/h3>\n<p>When it comes to deciding on the best architecture for your load test, it is important to determine what your ultimate testing goals are. If you are intending to stress your target test application and probe for breaking points, most often a scripted test is the best option for this. There are some exceptions however. One might be a scenario where you are performing functional testing with some load requirement. In this case the Selenium test might be advantageous in that it will capture how the user interface responds.<\/p>\n<p>Another scenario where you might utilize a Selenium WebDriver test is for a web application that is too complex to simulate using scripted requests. Examples of such are those which rely heavily on <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ajax_(programming)\">Ajax<\/a> requests and complex responses that are best simulated using a full web browser instance.<\/p>\n<p>Regardless of your specific testing needs, the selection between scripted tests using something like JMeter versus Selenium WebDriver will likely be under some budgetary constraint. Selenium tests are always more resource intensive, and that must be factored in when choosing your test plan architecture.<\/p>\n<h3>JMeter as an Alternative to Selenium<\/h3>\n<p><span style=\"font-weight: 400;\">Even though Selenium WebDriver most closely simulates the end user experience recreating it with high accuracy, it is resource intensive.\u00a0 If we are more concerned with stress testing our target test application we can do this more efficiently with a scripted framework such as <\/span><a href=\"https:\/\/www.redline13.com\/blog\/docs\/jmeter-tests\/\"><span style=\"font-weight: 400;\">JMeter<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0 This is especially true when massively scaled load testing is indicated into the thousands or millions of virtual users and beyond.\u00a0 In these cases, JMeter will almost always be the superior choice.<\/span><\/p>\n<hr \/>\n<p>Did you know that RedLine13 offers a full-featured free trial?\u00a0 <a href=\"https:\/\/www.redline13.com\/Service\">Sign up now<\/a> and move your Selenium WebDriver load testing to the cloud today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tests created with Selenium WebDriver replicate the user experience from the perspective of the UI.\u00a0 It can be thought of as a top-down approach whereby it accurately replicates the behavior of an end user. Running through a browser instance such as Chrome or Firefox, the test process itself interacts with the actual user interface elements of a target test application. This is in contrast to many other testing frameworks.\u00a0 One of the most popular is JMeter,<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":11,"featured_media":10365,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,45],"tags":[608,283,318,388,424,457],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-dkoziel","4":"post-10364","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-selenium","10":"post_tag-functional-testing","11":"post_tag-jmeter","12":"post_tag-load-testing","13":"post_tag-performance","14":"post_tag-redline13","15":"post_tag-selenium-webdriver"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Pitfalls of Selenium Load Testing - RedLine13<\/title>\n<meta name=\"description\" content=\"In this post, we will discuss how Selenium WebDriver tests differ from scripted test frameworks like JMeter, and some pitfalls using Selenium.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pitfalls of Selenium Load Testing - RedLine13\" \/>\n<meta property=\"og:description\" content=\"In this post, we will discuss how Selenium WebDriver tests differ from scripted test frameworks like JMeter, and some pitfalls using Selenium.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-02T21:27:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-22T18:18:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Koziel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Koziel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\"},\"author\":{\"name\":\"David Koziel\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\"},\"headline\":\"Pitfalls of Selenium Load Testing\",\"datePublished\":\"2023-03-02T21:27:05+00:00\",\"dateModified\":\"2023-06-22T18:18:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\"},\"wordCount\":643,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"Functional Testing\",\"JMeter\",\"Load Testing\",\"Performance\",\"RedLine13\",\"selenium webdriver\"],\"articleSection\":[\"Blog\",\"Selenium\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\",\"name\":\"Pitfalls of Selenium Load Testing - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2023-03-02T21:27:05+00:00\",\"dateModified\":\"2023-06-22T18:18:33+00:00\",\"description\":\"In this post, we will discuss how Selenium WebDriver tests differ from scripted test frameworks like JMeter, and some pitfalls using Selenium.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pitfalls of Selenium Load Testing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\",\"name\":\"David Koziel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"caption\":\"David Koziel\"},\"url\":\"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pitfalls of Selenium Load Testing - RedLine13","description":"In this post, we will discuss how Selenium WebDriver tests differ from scripted test frameworks like JMeter, and some pitfalls using Selenium.","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:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/","og_locale":"en_US","og_type":"article","og_title":"Pitfalls of Selenium Load Testing - RedLine13","og_description":"In this post, we will discuss how Selenium WebDriver tests differ from scripted test frameworks like JMeter, and some pitfalls using Selenium.","og_url":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/","og_site_name":"RedLine13","article_published_time":"2023-03-02T21:27:05+00:00","article_modified_time":"2023-06-22T18:18:33+00:00","og_image":[{"width":400,"height":300,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2023\/03\/word-image-10364-1.png","type":"image\/png"}],"author":"David Koziel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Koziel","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/"},"author":{"name":"David Koziel","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20"},"headline":"Pitfalls of Selenium Load Testing","datePublished":"2023-03-02T21:27:05+00:00","dateModified":"2023-06-22T18:18:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/"},"wordCount":643,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["Functional Testing","JMeter","Load Testing","Performance","RedLine13","selenium webdriver"],"articleSection":["Blog","Selenium"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/","url":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/","name":"Pitfalls of Selenium Load Testing - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2023-03-02T21:27:05+00:00","dateModified":"2023-06-22T18:18:33+00:00","description":"In this post, we will discuss how Selenium WebDriver tests differ from scripted test frameworks like JMeter, and some pitfalls using Selenium.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2023\/03\/pitfalls-of-selenium-load-testing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Pitfalls of Selenium Load Testing"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20","name":"David Koziel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","caption":"David Koziel"},"url":"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/10364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=10364"}],"version-history":[{"count":6,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/10364\/revisions"}],"predecessor-version":[{"id":10405,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/10364\/revisions\/10405"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/10365"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=10364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=10364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=10364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}