|Refer to the below Links for Practise|
Complete JAVA QUIZ
Selenium Advanced Quiz
50 Real Time Interview Questions
REST API QUIZ
The Apache JMeter™ application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
Apache JMeter features include:
Ability to load and performance test many different applications/server/protocol types:
• Web – HTTP, HTTPS (Java, NodeJS, PHP, ASP.NET, …)
• SOAP / REST Webservices
• Database via JDBC
• Message-oriented middleware (MOM) via JMS
• Mail – SMTP(S), POP3(S) and IMAP(S)
• Native commands or shell scripts
• Java Objects
Execute the Selenium Scripts in JMETER and verify the average response time taken in the execution of Selenium Scripts.
1. Download the Apache JMETER zip file from this link -> https://jmeter.apache.org/download_jmeter.cgi
Example: Download apache-jmeter-x.0.zip file.
2. Unzip the file and verify the contents of the JMETER.
3. Download the jmeter-plugins-webdriver from this link https://jmeter-plugins.org/?search=jpgc-webdriver and extract the contents and copy in the JMETER/lib folder.
Example: Download jpgc-webdriver-2.3.zip file.
4. Download the Java Native Access jars and JNA Platform jars and extract the files and copy in the JMETER/lib folder as shown below:
Java Native Access[JNA] allows you to call directly into native functions using natural Java method invocation. The Java call looks just like the call does in native code. Most calls require no special handling or configuration.
5. Open JMeter bat available under JMeter/bin folder.
• Right Click on Test Plan->Create Thread Group.
• Right Click on Thread Group->Select Sampler->WebDriver Sampler
• Right Click on Thread Group-> Select Config Element->Firefox Driver Config.
• Right Click on Thread Group->Listener->View Results in Table.
Sampler->Samplers tell JMeter to send requests to a server and wait for a response.
Config->Configuration elements can be used to set up defaults and variables for later use by samplers.
Listeners->A listener is a component that shows the results of the samples.
6. Copy the Jmeter Script in the WebDriver Sampler as shown below:
WDS.sampleResult.sampleStart(); //captures sampler's start time
// 1. Open the Web Application
// 2. Enter characters into the text input field
var pkg = JavaImporter(org.openqa.selenium)
var what = WDS.browser.findElement(pkg.By.id('what'))
var where = WDS.browser.findElement(pkg.By.id('where'))
// 3. Click on the button to submit the form
var button = WDS.browser.findElement(pkg.By.id('fj'))
// 4. Verify successful form submission
var results = WDS.browser.findElements(pkg.By.cssSelector('.summary'))
WDS.sampleResult.successful = false
WDS.sampleResult.responseMessage = 'There were no results returned'
7. Execute the Jmeter Script and verify the Results in the View Results Table Listener for the Sample Time captured for executing the Selenium Script.