DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Functional Testing for Ensuring Failsafe Operation of SaaS Applications
  • Queuing Theory for Non-Functional Testing
  • Set Theory Fundamentals For Software Testing
  • The Essential Guide To Effective Software Testing

Trending

  • A New Era of Unified Lakehouse: Who Will Reign? A Deep Dive into Apache Doris vs. ClickHouse
  • Lessons Learned in Test-Driven Development
  • Monitoring and Managing the Growth of the MSDB System Database in SQL Server
  • Building Scalable and Resilient UI/UX With Angular and Node.js
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Automated Functional Testing Using WebDriver Sampler With JMeter

Automated Functional Testing Using WebDriver Sampler With JMeter

This quick walkthrough shows how to automate functional testing on the client side with JMeter.

By 
Rupesh Garg user avatar
Rupesh Garg
·
Nov. 12, 18 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
12.7K Views

Join the DZone community and get the full member experience.

Join For Free

Up to this point, performance testing has been on the server side of things as JMeter does not include the time needed to render the response, nor does JMeter process any client code, for example, JavaScript. Things that add to the overall browser execution time may include:

  • Client-side JavaScript execution, e.g. AJAX, JS templates

  • CSS transforms, e.g. 3D matrix transforms, animations

  • Third-party plugins, e.g. youtube Double click ads, site analytics, etc.

The JMeter ecosystem is very rich, so there is a solution for this; we will use WebDriver Sampler in JMeter as this sampler automates the execution and collection of performance metrics on client-side.

To get WebDriver Sampler, click here. 

Also we need to install the browser Driver plugins of JMeter to run the test on the particular browser like jp@gc - Chrome Driver Config, jp@gc - Firefox Driver Config, etc.

Configuration of WebDriver Sampler Test

  1. Add a Thread Group to the Test Plan, and add HTTP Cookie Manager, jp@gc - Firefox Driver Config (from Config Element), jp@gc - WebDriver Sampler (from Sampler)to the Thread Group and a listener View Results in Table.

  2. Write/Add the code in the WebDriver Sampler which you want to test. Here is the sample code, where it says to open www.frugaltesting.com website and to get load time of it:

WDS.sampleResult.sampleStart()
WDS.browser.get('https://www.frugaltesting.com')
WDS.sampleResult.sampleEnd()

Image title

Now when we hit the "play" button, JMeter will open a Firefox browser and search www.frugaltesting.com site and end the test as browser closes automatically after performing the actions according to the script (sample script) in the Web Driver Sampler.

We can see the sample result in the View Result Table.Image title

Limitations of WebDriver Sampler

  • The reader should be prudent in the number of threads they will create as each thread will have a single browser instance associated with it.
  • As each browser consumes a significant amount of resources, so a limit should be placed on how many browsers the user should create.
Functional testing

Opinions expressed by DZone contributors are their own.

Related

  • Functional Testing for Ensuring Failsafe Operation of SaaS Applications
  • Queuing Theory for Non-Functional Testing
  • Set Theory Fundamentals For Software Testing
  • The Essential Guide To Effective Software Testing

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: