Skip to content
  • ZipCode Api
  • Blog
  • About RedLine13
RedLine13
RedLine13
Primary Navigation Menu
Menu
  • Start Testing
  • Demo
  • Pricing
  • JMeter
  • Partners
  • Docs
    • Documentation Home
    • AWS Set Up for load testing
    • AWS Approval for Large Tests
    • PHP, NodeJS, Python Load Tests
    • Scalability
    • Jenkins Plugin Setup
    • Premium Features
    • Knowledge Base

Load Testing a BrowserStack Script

By: RedLine13

BrowserStack is a popular cloud testing platform because it provides instant access to all desktop and mobile browsers. And you don’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 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.

BrowserStack Script

Below is a simple automation code written in Node.js to perform a cloud test on BrowserStack.

Here is a script for BrowserStack:

var webdriver = require('selenium-webdriver');
var capabilities = {
 'browserName' : 'Chrome',
 'browser_version' : '62.0',
 'browserstack.local':true,
 'os' : 'Windows',
 'os_version' : '10',
 'resolution' : '1024x768',
 'browserstack.user' : 'mahirkaplanc1',
 'browserstack.key' : ''
}

var driver = new webdriver.Builder().
  usingServer('http://hub-cloud.browserstack.com/wd/hub').
  withCapabilities(capabilities).
  build();

driver.get('http://slot8.ss.etiya.com/telaura/faces/telaura').then(function(){
  driver.findElement(webdriver.By.name('uname')).sendKeys('username\n').then(function(){
    driver.findElement(webdriver.By.name('password')).sendKeys('password\n').then(function(){
      driver.findElement(webdriver.By.id('cb1')).click().then(function(){
    
      driver.quit();
  });
  });
  });
});

We will modify and simplify the script to run it on the Redline13 load testing platform.

test.js

var redline = require( 'redline13-webdriver' );  //import redline13 library
var driver = redline.loadBrowser('chrome');  //this might be chrome,firefox,phantomjs.
var By = redline.webdriver.By; // using By library for locator 
var URL = "http://slot8.ss.etiya.com/telaura/faces/telaura";
//Rest of the code is the same of Webdriver code
driver.get(URL);  //navigate to url
driver.manage().window().maximize();
driver.findElement(By.name("uname")).sendKeys("username");  // enter username 
driver.findElement(By.name("password")).sendKeys("password"); // enter password
driver.findElement(By.id("cb1")).click();      // enter login button
driver.quit();

Both of these use a Javascript programming language. However we can use the “redline13-webdriver” library to create a script with easier syntax and much clearer. And you won’t have to handle Javascript promises.

If you don’t have Redline13 library, just run the following to set it up:

npm install redline13-webdriver

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:

node test.js

Running a Load Test

It’s time to upload the script on Redline13 to perform a load test.

Steps are:

  • https://www.redline13.com/StartTest start test
  • Select ‘Custom Test’
  • Set Number of Users to 50 (or any number you want)
  • Upload Custom – drop in your test.js file
  • start-webdriver-node-test
  • In Advanced Custom Test Options select ‘WebDriver NodeJS’ plugin
    • You will need two RedLine13 Plugins which can be added via https://www.redline13.com/Account/plugins
      • Node Version Manager
      • WebDriver NodeJS
  • Select ‘PhantomJS’ as the browser type
  • setup-webdriver-nodejs-with-phantomjs
    • Domains – You can provide a space separated list of domains which will track full URLs from that URL
      • Other domains will be truncated to their domain name and recorded, lumping together all metrics from a domain. For example, all google analytics calls.
    • Hard Filter – If checked, will only track from the domains specified, other metrics will not be recorded.
    • Capture ScreenShot on Error – If checked, when the script throws an error, an image will automatically be captured if possible and be available at end of test.
  • Start Test
  • Watch Results

Conclusion

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.

2018-03-02
Previous Post: Practical Advice for Fast Growth Companies and Load Testing
Next Post: Continuous Performance

Recent Posts

  • JMeter XML Format Post Processor
  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener

Related

  • JMeter XML Format Post Processor
  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener
  • Using Test Fragments in JMeter Tests
  • Step-by-Step Guide to Testing with JMeter
  • Functional Testing vs Performance Testing
  • A Gentle Introduction to Load Testing
  • Using the JMeter Counter Element

© RedLine13, LLC | Privacy Policy | Contract
Contact Us: info@redline13.com

Designed using Responsive Brix. Powered by WordPress.