SlideShare a Scribd company logo
1 of 11
Bean Shell Scripting in
Apache JMeter
NAVEENKUMAR NAMACHIVAYAM
Founder – QAInsights.com
http://QAInsights.com
Introduction to Beanshell
• BeanShell is a Java-like scripting language, invented by Patrick Niemeyer.
• Pure Java
• Free
• Runs in the Java Runtime Environment and uses Java syntax
• BeanShell is small and embeddable, so you can call BeanShell from your Java applications to
execute Java code dynamically at run-time
• standalone BeanShell scripts to manipulate Java applications; working with Java objects and
APIs dynamically.
• Runs in four modes: Command Line, Console, Applet, Remote Session Server.
• With BeanShell you can create custom outputs, perform logical operations, manipulate
variables, etc.
Scripting Features
• Optionally typed variables.
• Scripted methods with optionally typed arguments and return values
• Scripted objects (method closures)
• Scripted interfaces and event handlers.
• Convenience syntax for working with JavaBean properties, hashtables, and primitive wrapper
types.
• Auto-allocation of variables to emulate Java properties files.
• Extensible set of utility and shell-like commands
• Dynamic classpath management including find grained class reloading
• Dynamic command loading and user command path
• Sophisticated namespace and callstack management
• Detailed error reporting
Bean Shell Sampler
• In order to manipulate and work on the response data, Bean Shell sampler would be a great
element.
• To add Bean Shell sampler, right click, Add > Sampler > Bean Shell Sampler.
Bean Shell Sampler
• In this example, user name will be retrieved and manipulated using Bean Shell sampler.
• If the username is not equal to NAVEENKUMAR NAMACHIVAYAM, then the thread will stop.
• Use Regular Expression Extractor to extract the username as shown below.
Bean Shell Sampler
• Once the username is extracted, add Bean Shell Sampler to manipulate.
• Here the username will be stored in username variable.
• To get the extracted value in Bean Shell sampler, use below syntax.
• String userName = vars.get("username");
• Next step is to check the condition using if statement.
• if (userName != "NAVEENKUMAR NAMACHIVAYAM")
• You can use Data set config file variable too, if you do not want to hard code the user name.
• Now, if the condition is true, following statement will be used to terminate the execution.
• SampleResult.setStopThread(true);
• Below statement will be used to return the value.
• return userName
Bean Shell Sampler
Bean Shell Sampler Output
Bean Shell Sampler – Some more enhancement
• To print the output to command prompt, you can use
• System.out.println statement
• System.out.println("Response Code is " + ResponseCode);
• System.out.println("Response Message is " + ResponseMessage);
• if (SampleResult.isSuccessful())
• {
• System.out.println("Success");
• SampleResult.setStopTest(true);
• SampleResult.setStopThread(true);
• }
Bean Shell Sampler – Some more enhancement
Thank you
Please visit http://qainsights.com/services for more training programs.

More Related Content

What's hot

oracle enterprise asset management ppt
oracle enterprise asset management pptoracle enterprise asset management ppt
oracle enterprise asset management pptEjaz Hussain
 
Oracle Integration Cloud Service (ICS) best practices learned from the field
Oracle Integration Cloud Service (ICS) best practices learned from the fieldOracle Integration Cloud Service (ICS) best practices learned from the field
Oracle Integration Cloud Service (ICS) best practices learned from the fieldRobert van Mölken
 
Transforming Financial Insights with Oracle EPM
Transforming Financial Insights with Oracle EPMTransforming Financial Insights with Oracle EPM
Transforming Financial Insights with Oracle EPMSmart ERP Solutions, Inc.
 
OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]
OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]
OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]vasuballa
 
Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...
Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...
Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...Bottomline Technologies
 
Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce Associates
 
Reduce Amazon RDS Costs up to 50% with Proxies
Reduce Amazon RDS Costs up to 50% with ProxiesReduce Amazon RDS Costs up to 50% with Proxies
Reduce Amazon RDS Costs up to 50% with ProxiesJohn Varghese
 
Oracle Fusion Applications Accounts Payables
Oracle Fusion Applications Accounts PayablesOracle Fusion Applications Accounts Payables
Oracle Fusion Applications Accounts PayablesBerry Clemens
 
Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...
Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...
Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...Fishbowl Solutions
 
Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)Amazon Web Services
 
Training Guide Oracle EBS R12 Performance Management
Training Guide Oracle EBS R12 Performance ManagementTraining Guide Oracle EBS R12 Performance Management
Training Guide Oracle EBS R12 Performance ManagementFeras Ahmad
 
Demystify Salesforce Bulk API
Demystify Salesforce Bulk APIDemystify Salesforce Bulk API
Demystify Salesforce Bulk APIDhanik Sahni
 
Performance Testing
Performance TestingPerformance Testing
Performance Testingsharmaparish
 
Exploiting IAM in the google cloud platform - dani_goland_mohsan_farid
Exploiting IAM in the google cloud platform - dani_goland_mohsan_faridExploiting IAM in the google cloud platform - dani_goland_mohsan_farid
Exploiting IAM in the google cloud platform - dani_goland_mohsan_faridCloudVillage
 
Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112magik570
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerAmazon Web Services
 

What's hot (20)

oracle enterprise asset management ppt
oracle enterprise asset management pptoracle enterprise asset management ppt
oracle enterprise asset management ppt
 
Oracle Applications R12 Sourcing Training
Oracle Applications R12 Sourcing TrainingOracle Applications R12 Sourcing Training
Oracle Applications R12 Sourcing Training
 
Oracle Integration Cloud Service (ICS) best practices learned from the field
Oracle Integration Cloud Service (ICS) best practices learned from the fieldOracle Integration Cloud Service (ICS) best practices learned from the field
Oracle Integration Cloud Service (ICS) best practices learned from the field
 
Transforming Financial Insights with Oracle EPM
Transforming Financial Insights with Oracle EPMTransforming Financial Insights with Oracle EPM
Transforming Financial Insights with Oracle EPM
 
AWS IAM Introduction
AWS IAM IntroductionAWS IAM Introduction
AWS IAM Introduction
 
Demantra & ascp
Demantra & ascpDemantra & ascp
Demantra & ascp
 
OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]
OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]
OOW16 - Oracle E-Business Suite Integration Best Practices [CON6709]
 
Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...
Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...
Invoice and Payment Automation for Oracle EBS. Bottomline and Buzzi at COLLAB...
 
Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce administrator training presentation slides
Salesforce administrator training presentation slides
 
Reduce Amazon RDS Costs up to 50% with Proxies
Reduce Amazon RDS Costs up to 50% with ProxiesReduce Amazon RDS Costs up to 50% with Proxies
Reduce Amazon RDS Costs up to 50% with Proxies
 
Oracle Fusion Applications Accounts Payables
Oracle Fusion Applications Accounts PayablesOracle Fusion Applications Accounts Payables
Oracle Fusion Applications Accounts Payables
 
Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...
Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...
Accelerate Your PeopleSoft Accounts Payable Process Into Overdrive with Oracl...
 
Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)
 
Training Guide Oracle EBS R12 Performance Management
Training Guide Oracle EBS R12 Performance ManagementTraining Guide Oracle EBS R12 Performance Management
Training Guide Oracle EBS R12 Performance Management
 
Extensibility
ExtensibilityExtensibility
Extensibility
 
Demystify Salesforce Bulk API
Demystify Salesforce Bulk APIDemystify Salesforce Bulk API
Demystify Salesforce Bulk API
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Exploiting IAM in the google cloud platform - dani_goland_mohsan_farid
Exploiting IAM in the google cloud platform - dani_goland_mohsan_faridExploiting IAM in the google cloud platform - dani_goland_mohsan_farid
Exploiting IAM in the google cloud platform - dani_goland_mohsan_farid
 
Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets Manager
 

Viewers also liked

Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeterjvSlideshare
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance TestingAtul Pant
 
How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in JmeterViviana Lesmes
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With JmeterAdam Goucher
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And MavenPerconaPerformance
 
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...Positive Hack Days
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeterBhojan Rajan
 

Viewers also liked (12)

Installing Groovy engine in Apache Jmeter
Installing Groovy engine in Apache JmeterInstalling Groovy engine in Apache Jmeter
Installing Groovy engine in Apache Jmeter
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeter
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
 
How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in Jmeter
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With Jmeter
 
Tasks
TasksTasks
Tasks
 
Timers in Apache JMeter
Timers in Apache JMeterTimers in Apache JMeter
Timers in Apache JMeter
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And Maven
 
How to start performance testing project
How to start performance testing projectHow to start performance testing project
How to start performance testing project
 
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeter
 
Algorithm Class is a Training Institute on C, C++, CPP, DS, JAVA, data struct...
Algorithm Class is a Training Institute on C, C++, CPP, DS, JAVA, data struct...Algorithm Class is a Training Institute on C, C++, CPP, DS, JAVA, data struct...
Algorithm Class is a Training Institute on C, C++, CPP, DS, JAVA, data struct...
 

Similar to Beanshell scripting in Apache JMeter

Bshmanual
BshmanualBshmanual
Bshmanual涛 相
 
Vibe Custom Development
Vibe Custom DevelopmentVibe Custom Development
Vibe Custom DevelopmentGWAVA
 
Variables and User Input
Variables and User InputVariables and User Input
Variables and User Inputprimeteacher32
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React AppAll Things Open
 
Unit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma introUnit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma introMaurice De Beijer [MVP]
 
Oracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical Discussion
Oracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical DiscussionOracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical Discussion
Oracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical DiscussionJoshua Johnson, MIS
 
Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshopseleniumconf
 
Eureka Moment UKLUG
Eureka Moment UKLUGEureka Moment UKLUG
Eureka Moment UKLUGPaul Withers
 
Ansible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex RestoresAnsible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex RestoresAbhilash Kumar
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play FrameworkWarren Zhou
 
Data Evolution on HBase with Kiji
Data Evolution on HBase with KijiData Evolution on HBase with Kiji
Data Evolution on HBase with KijiWibiData
 
Data Evolution on HBase (with Kiji)
Data Evolution on HBase (with Kiji)Data Evolution on HBase (with Kiji)
Data Evolution on HBase (with Kiji)Adam Kunicki
 
深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用
深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用
深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用Amazon Web Services
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAlberto Molina Coballes
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5jakemallory
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Developmentpanagenda
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action Alex Movila
 
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)Julien SIMON
 
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkDeploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkAmazon Web Services
 

Similar to Beanshell scripting in Apache JMeter (20)

Bshmanual
BshmanualBshmanual
Bshmanual
 
Vibe Custom Development
Vibe Custom DevelopmentVibe Custom Development
Vibe Custom Development
 
Variables and User Input
Variables and User InputVariables and User Input
Variables and User Input
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
Unit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma introUnit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma intro
 
Oracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical Discussion
Oracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical DiscussionOracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical Discussion
Oracle Cloud Compute - EBS 12.2.5 Vision Demo - Technical Discussion
 
Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshop
 
Eureka Moment UKLUG
Eureka Moment UKLUGEureka Moment UKLUG
Eureka Moment UKLUG
 
Ansible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex RestoresAnsible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex Restores
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play Framework
 
Data Evolution on HBase with Kiji
Data Evolution on HBase with KijiData Evolution on HBase with Kiji
Data Evolution on HBase with Kiji
 
Data Evolution on HBase (with Kiji)
Data Evolution on HBase (with Kiji)Data Evolution on HBase (with Kiji)
Data Evolution on HBase (with Kiji)
 
深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用
深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用
深探-IaC-(Infrastructure as Code-基礎設施即程式碼-)-在-AWS-上的應用
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Development
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
 
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkDeploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 

More from NaveenKumar Namachivayam

More from NaveenKumar Namachivayam (17)

Start up ideas - Search Engines for Apps
Start up ideas - Search Engines for AppsStart up ideas - Search Engines for Apps
Start up ideas - Search Engines for Apps
 
Interesting facts about IRCTC and Lessons for Performance Testers
Interesting facts about IRCTC and Lessons for Performance TestersInteresting facts about IRCTC and Lessons for Performance Testers
Interesting facts about IRCTC and Lessons for Performance Testers
 
Web service testing using QTP (UFT)
Web service testing using QTP (UFT)Web service testing using QTP (UFT)
Web service testing using QTP (UFT)
 
Types of performance testing
Types of performance testingTypes of performance testing
Types of performance testing
 
Internationalization Test Approach - Full Whitepaper
Internationalization Test Approach - Full WhitepaperInternationalization Test Approach - Full Whitepaper
Internationalization Test Approach - Full Whitepaper
 
Working faster MS Outlook Advance
Working faster MS Outlook AdvanceWorking faster MS Outlook Advance
Working faster MS Outlook Advance
 
Customizing Outlook MS Outlook Advance
Customizing Outlook MS Outlook AdvanceCustomizing Outlook MS Outlook Advance
Customizing Outlook MS Outlook Advance
 
Formatting Options MS Outlook Advance
Formatting Options MS Outlook AdvanceFormatting Options MS Outlook Advance
Formatting Options MS Outlook Advance
 
Contacts
ContactsContacts
Contacts
 
Message modifications MS Outlook Intermediate
Message modifications MS Outlook IntermediateMessage modifications MS Outlook Intermediate
Message modifications MS Outlook Intermediate
 
Email Enhancements MS Outlook Intermediate
Email Enhancements MS Outlook IntermediateEmail Enhancements MS Outlook Intermediate
Email Enhancements MS Outlook Intermediate
 
Journal and Notes
Journal and NotesJournal and Notes
Journal and Notes
 
Calendar
CalendarCalendar
Calendar
 
Organizing messages
Organizing messagesOrganizing messages
Organizing messages
 
Email Feature
Email FeatureEmail Feature
Email Feature
 
Messages - MS Outlook
Messages - MS OutlookMessages - MS Outlook
Messages - MS Outlook
 
Getting started with Outlook
Getting started with OutlookGetting started with Outlook
Getting started with Outlook
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 

Beanshell scripting in Apache JMeter

  • 1. Bean Shell Scripting in Apache JMeter NAVEENKUMAR NAMACHIVAYAM Founder – QAInsights.com http://QAInsights.com
  • 2. Introduction to Beanshell • BeanShell is a Java-like scripting language, invented by Patrick Niemeyer. • Pure Java • Free • Runs in the Java Runtime Environment and uses Java syntax • BeanShell is small and embeddable, so you can call BeanShell from your Java applications to execute Java code dynamically at run-time • standalone BeanShell scripts to manipulate Java applications; working with Java objects and APIs dynamically. • Runs in four modes: Command Line, Console, Applet, Remote Session Server. • With BeanShell you can create custom outputs, perform logical operations, manipulate variables, etc.
  • 3. Scripting Features • Optionally typed variables. • Scripted methods with optionally typed arguments and return values • Scripted objects (method closures) • Scripted interfaces and event handlers. • Convenience syntax for working with JavaBean properties, hashtables, and primitive wrapper types. • Auto-allocation of variables to emulate Java properties files. • Extensible set of utility and shell-like commands • Dynamic classpath management including find grained class reloading • Dynamic command loading and user command path • Sophisticated namespace and callstack management • Detailed error reporting
  • 4. Bean Shell Sampler • In order to manipulate and work on the response data, Bean Shell sampler would be a great element. • To add Bean Shell sampler, right click, Add > Sampler > Bean Shell Sampler.
  • 5. Bean Shell Sampler • In this example, user name will be retrieved and manipulated using Bean Shell sampler. • If the username is not equal to NAVEENKUMAR NAMACHIVAYAM, then the thread will stop. • Use Regular Expression Extractor to extract the username as shown below.
  • 6. Bean Shell Sampler • Once the username is extracted, add Bean Shell Sampler to manipulate. • Here the username will be stored in username variable. • To get the extracted value in Bean Shell sampler, use below syntax. • String userName = vars.get("username"); • Next step is to check the condition using if statement. • if (userName != "NAVEENKUMAR NAMACHIVAYAM") • You can use Data set config file variable too, if you do not want to hard code the user name. • Now, if the condition is true, following statement will be used to terminate the execution. • SampleResult.setStopThread(true); • Below statement will be used to return the value. • return userName
  • 9. Bean Shell Sampler – Some more enhancement • To print the output to command prompt, you can use • System.out.println statement • System.out.println("Response Code is " + ResponseCode); • System.out.println("Response Message is " + ResponseMessage); • if (SampleResult.isSuccessful()) • { • System.out.println("Success"); • SampleResult.setStopTest(true); • SampleResult.setStopThread(true); • }
  • 10. Bean Shell Sampler – Some more enhancement
  • 11. Thank you Please visit http://qainsights.com/services for more training programs.