Yashas-N-R opened a new issue, #6416:
URL: https://github.com/apache/jmeter/issues/6416

   ### Use case
   
   Problem:
   In many testing workflows, functional tests (using Selenium or similar 
tools) and performance tests (using JMeter or other load-testing tools) are 
handled separately. This separation makes it harder to reuse work done in 
functional testing for performance testing.
   Use Case:
   By recording API calls made during Selenium browser interactions, this 
plugin bridges the gap between UI functional testing and backend performance 
testing.
   Teams can automate their functional workflows in Selenium and automatically 
replicate those workflows as API test plans in JMeter for performance testing.
   
   ### Possible solution
   
   The plugin workflow will involve:
   
   Selenium Automation:
   
   Use Selenium to open the application in Firefox (or other browsers), 
interact with the UI (clicks, scrolling, form submissions, etc.), and perform 
actions that trigger API calls.
   
   Integrating JMeter's Proxy Recorder:
   
   Leverage JMeter's HTTP(S) Proxy Recorder (ProxyControl) to intercept all 
HTTP/HTTPS traffic from the browser.
   Configure Selenium WebDriver with a proxy pointing to JMeter's Proxy 
Recorder (localhost:8888) to route its traffic through JMeter.
   
   Dynamic Conversion of API Requests:
   
   Parse intercepted HTTP/HTTPS requests and dynamically convert them into 
JMeter HTTP Samplers (e.g., HTTPSamplerProxy) that are added to the Recording 
Controller in JMeter.
   
   Output: A JMeter Test Plan:
   
   All requests are captured and added to a JMeter Test Plan in real-time. This 
test plan can then be used for performance or load testing with multiple 
virtual users.
   
   ### Possible workarounds
   
   Start JMeter’s Proxy Recorder:
   
   Open JMeter, add an HTTP(S) Test Script Recorder.
   Configure the Proxy Server to listen on localhost:8888 (or another port of 
your choice).
   Ensure the recorder's target controller is set to your Recording Controller.
   Manually Configure the Proxy in Selenium:
   
   Configure Selenium’s WebDriver proxy settings to use JMeter’s recorder. A 
dummy Java example:
   
   Proxy proxy = new Proxy();
   proxy.setHttpProxy("localhost:8888");
   proxy.setSslProxy("localhost:8888");
   
   FirefoxOptions options = new FirefoxOptions();
   options.setProxy(proxy);
   
   WebDriver driver = new FirefoxDriver(options);
   driver.get("https://example.com";);
   
   // Perform interactions with the page
   WebElement element = driver.findElement(By.id("button"));
   element.click();
   Automate and Record API Traffic:
   
   As you interact with the browser through Selenium, the HTTP(S) Test Script 
Recorder captures and converts the API traffic into HTTP Samplers stored in the 
Recording Controller.
   Generate and Save the Test Plan:
   
   Once done, save the Recording Controller’s content as a .jmx file. This 
becomes your test plan for API load testing.
   
   ### JMeter Version
   
   5.6.3
   
   ### Java Version
   
   _No response_
   
   ### OS Version
   
   Microsoft windows 10 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to