{"id":4626,"date":"2018-03-02T09:27:40","date_gmt":"2018-03-02T14:27:40","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=4626"},"modified":"2018-03-02T09:27:40","modified_gmt":"2018-03-02T14:27:40","slug":"load-testing-a-browserstack-script","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/","title":{"rendered":"Load Testing a BrowserStack Script"},"content":{"rendered":"<p><a href=\"https:\/\/www.browserstack.com\/\" target=\"_blank\" rel=\"noopener\">BrowserStack<\/a> is a popular cloud testing platform because it provides instant access to all desktop and mobile browsers. And you don&#8217;t have to set up virtual machines and devices and browsers. Furthermore, the most effective part is you can run your tests in parallel in different environments. The widest usage of this platform is running selenium scripts on the cloud. But what about load testing a BrowserStack script.<\/p>\n<p>BrowserStack does not do load testing. However, you can take the scripts that you create for BrowserStack and use them for load testing with a simple modification. This post will walk through the steps with an example script.<\/p>\n<h2>BrowserStack Script<\/h2>\n<p>Below is a simple automation code written in Node.js to perform a cloud test on BrowserStack.<\/p>\n<p>Here is a script for BrowserStack:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">var webdriver = require('selenium-webdriver');\nvar capabilities = {\n 'browserName' : 'Chrome',\n 'browser_version' : '62.0',\n 'browserstack.local':true,\n 'os' : 'Windows',\n 'os_version' : '10',\n 'resolution' : '1024x768',\n 'browserstack.user' : 'mahirkaplanc1',\n 'browserstack.key' : ''\n}\n\nvar driver = new webdriver.Builder().\n  usingServer('http:\/\/hub-cloud.browserstack.com\/wd\/hub').\n  withCapabilities(capabilities).\n  build();\n\ndriver.get('http:\/\/slot8.ss.etiya.com\/telaura\/faces\/telaura').then(function(){\n  driver.findElement(webdriver.By.name('uname')).sendKeys('username\\n').then(function(){\n    driver.findElement(webdriver.By.name('password')).sendKeys('password\\n').then(function(){\n      driver.findElement(webdriver.By.id('cb1')).click().then(function(){\n    \n      driver.quit();\n  });\n  });\n  });\n});\n<\/pre>\n<p>We will modify and simplify the script to run it on the Redline13 load testing platform.<\/p>\n<p>test.js<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">var redline = require( 'redline13-webdriver' );  \/\/import redline13 library\nvar driver = redline.loadBrowser('chrome');  \/\/this might be chrome,firefox,phantomjs.\nvar By = redline.webdriver.By; \/\/ using By library for locator \nvar URL = \"http:\/\/slot8.ss.etiya.com\/telaura\/faces\/telaura\";\n\/\/Rest of the code is the same of Webdriver code\ndriver.get(URL);  \/\/navigate to url\ndriver.manage().window().maximize();\ndriver.findElement(By.name(\"uname\")).sendKeys(\"username\");  \/\/ enter username \ndriver.findElement(By.name(\"password\")).sendKeys(\"password\"); \/\/ enter password\ndriver.findElement(By.id(\"cb1\")).click();      \/\/ enter login button\ndriver.quit();<\/pre>\n<p>Both of these use a Javascript programming language. However we can use the \u201credline13-webdriver\u201d library to create a script with easier syntax and much clearer. And you won\u2019t have to handle Javascript promises.<\/p>\n<p>If you don\u2019t have Redline13 library, just run the following to set it up:<\/p>\n<blockquote><p><strong>npm install redline13-webdriver<\/strong><\/p><\/blockquote>\n<p>You have completed the installation. You are ready to run your script. You can check that your script works on your local machine with a command prompt:<\/p>\n<blockquote><p><strong>node test.js<\/strong><\/p><\/blockquote>\n<h2>Running a Load Test<\/h2>\n<p>It&#8217;s time to upload the script on Redline13 to perform a load test.<\/p>\n<p>Steps are:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.redline13.com\/StartTest\" target=\"_blank\" rel=\"noopener\">https:\/\/www.redline13.com\/StartTest<\/a> start test<\/li>\n<li>Select \u2018Custom Test\u2019<\/li>\n<li>Set Number of Users to 50 (or any number you want)<\/li>\n<li>Upload Custom \u2013 drop in your test.js file<\/li>\n<li><img loading=\"lazy\" decoding=\"async\" width=\"998\" height=\"346\" class=\"wp-image-4627\" src=\"https:\/\/d1u7j79bg1ays7.cloudfront.net\/blog\/wp-content\/uploads\/2018\/03\/start-webdriver-node-test.png\" alt=\"start-webdriver-node-test\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/start-webdriver-node-test.png 998w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/start-webdriver-node-test-300x104.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/start-webdriver-node-test-768x266.png 768w\" sizes=\"auto, (max-width: 998px) 100vw, 998px\" \/><\/li>\n<li>In Advanced Custom Test Options select \u2018WebDriver NodeJS\u2019 plugin\n<ul>\n<li>You will need two RedLine13 Plugins which can be added via <a href=\"https:\/\/www.redline13.com\/Account\/plugins\" target=\"_blank\" rel=\"noopener\">https:\/\/www.redline13.com\/Account\/plugins<\/a>\n<ul>\n<li>Node Version Manager<\/li>\n<li>WebDriver NodeJS<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Select \u2018PhantomJS\u2019 as the browser type<\/li>\n<li><img loading=\"lazy\" decoding=\"async\" width=\"999\" height=\"680\" class=\"wp-image-4628\" src=\"https:\/\/d1u7j79bg1ays7.cloudfront.net\/blog\/wp-content\/uploads\/2018\/03\/setup-webdriver-nodejs-with-phantomjs.png\" alt=\"setup-webdriver-nodejs-with-phantomjs\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/setup-webdriver-nodejs-with-phantomjs.png 999w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/setup-webdriver-nodejs-with-phantomjs-300x204.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/setup-webdriver-nodejs-with-phantomjs-768x523.png 768w\" sizes=\"auto, (max-width: 999px) 100vw, 999px\" \/>\n<ul>\n<li>Domains \u2013 You can provide a space separated list of domains which will track full URLs from that URL\n<ul>\n<li>Other domains will be truncated to their domain name and recorded, lumping together all metrics from a domain. For example, all google analytics calls.<\/li>\n<\/ul>\n<\/li>\n<li>Hard Filter \u2013 If checked, will only track from the domains specified, other metrics will not be recorded.<\/li>\n<li>Capture ScreenShot on Error \u2013 If checked, when the script throws an error, an image will automatically be captured if possible and be available at end of test.<\/li>\n<\/ul>\n<\/li>\n<li>Start Test<\/li>\n<li>Watch Results<\/li>\n<\/ul>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Follow these steps and you can begin load testing a BrowserStack script on the cloud. You can take that selenium automation script and perform a load test with thousands of concurrent users.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BrowserStack is a popular cloud testing platform because it provides instant access to all desktop and mobile browsers. And you don&#8217;t have to set up virtual machines and devices and browsers. Furthermore, the most effective part is you can run your tests in parallel in different environments. The widest usage of this platform is running selenium scripts on the cloud. But what about load testing a BrowserStack script. BrowserStack does not do load testing. However, you<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":4629,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,20,35,52],"tags":[456],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-user","4":"post-4626","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-browserstack","10":"category-load-testing","11":"category-webdriver","12":"post_tag-selenium"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Load Testing a BrowserStack script on the Cloud with Redline13<\/title>\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\/2018\/03\/load-testing-a-browserstack-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Load Testing a BrowserStack script on the Cloud with Redline13\" \/>\n<meta property=\"og:description\" content=\"BrowserStack is a popular cloud testing platform because it provides instant access to all desktop and mobile browsers. And you don&#8217;t have to set up virtual machines and devices and browsers. Furthermore, the most effective part is you can run your tests in parallel in different environments. The widest usage of this platform is running selenium scripts on the cloud. But what about load testing a BrowserStack script. BrowserStack does not do load testing. However, youRead More &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-02T14:27:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/BrowserStack.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2156\" \/>\n\t<meta property=\"og:image:height\" content=\"632\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"RedLine13\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"RedLine13\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/\"},\"author\":{\"name\":\"RedLine13\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28\"},\"headline\":\"Load Testing a BrowserStack Script\",\"datePublished\":\"2018-03-02T14:27:40+00:00\",\"dateModified\":\"2018-03-02T14:27:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/\"},\"wordCount\":445,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"selenium\"],\"articleSection\":[\"Blog\",\"BrowserStack\",\"Load Testing\",\"webdriver\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/\",\"name\":\"Load Testing a BrowserStack script on the Cloud with Redline13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2018-03-02T14:27:40+00:00\",\"dateModified\":\"2018-03-02T14:27:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Load Testing a BrowserStack Script\"}]},{\"@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\/4acbcdcb8a9c72ec5a274e69c0ebea28\",\"name\":\"RedLine13\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g\",\"caption\":\"RedLine13\"},\"sameAs\":[\"http:\/\/127.0.0.1\"],\"url\":\"https:\/\/www.redline13.com\/blog\/author\/user\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Load Testing a BrowserStack script on the Cloud with Redline13","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\/2018\/03\/load-testing-a-browserstack-script\/","og_locale":"en_US","og_type":"article","og_title":"Load Testing a BrowserStack script on the Cloud with Redline13","og_description":"BrowserStack is a popular cloud testing platform because it provides instant access to all desktop and mobile browsers. And you don&#8217;t have to set up virtual machines and devices and browsers. Furthermore, the most effective part is you can run your tests in parallel in different environments. The widest usage of this platform is running selenium scripts on the cloud. But what about load testing a BrowserStack script. BrowserStack does not do load testing. However, youRead More &rarr;","og_url":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/","og_site_name":"RedLine13","article_published_time":"2018-03-02T14:27:40+00:00","og_image":[{"width":2156,"height":632,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/03\/BrowserStack.png","type":"image\/png"}],"author":"RedLine13","twitter_card":"summary_large_image","twitter_misc":{"Written by":"RedLine13","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/"},"author":{"name":"RedLine13","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28"},"headline":"Load Testing a BrowserStack Script","datePublished":"2018-03-02T14:27:40+00:00","dateModified":"2018-03-02T14:27:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/"},"wordCount":445,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["selenium"],"articleSection":["Blog","BrowserStack","Load Testing","webdriver"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/","url":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/","name":"Load Testing a BrowserStack script on the Cloud with Redline13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2018-03-02T14:27:40+00:00","dateModified":"2018-03-02T14:27:40+00:00","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2018\/03\/load-testing-a-browserstack-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Load Testing a BrowserStack Script"}]},{"@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\/4acbcdcb8a9c72ec5a274e69c0ebea28","name":"RedLine13","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g","caption":"RedLine13"},"sameAs":["http:\/\/127.0.0.1"],"url":"https:\/\/www.redline13.com\/blog\/author\/user\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/4626","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=4626"}],"version-history":[{"count":0,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/4626\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/4629"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=4626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=4626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=4626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}