diff --git a/README.md b/README.md index aa41589..06b20c0 100644 --- a/README.md +++ b/README.md @@ -142,42 +142,43 @@ Help to see all parameters :
 C:\apache-jmeter\bin>har-convertor-to-jmeter.cmd -help
 
-usage: io.github.vdaburon.jmeter.har.HarForJMeter [-add_pause <add_pause>] [-external_file_infos <external_file_infos>]
-       [-filter_exclude <filter_exclude>] [-filter_include <filter_include>] -har_in <har_in> [-help] -jmx_out <jmx_out>
-       [-new_tc_pause <new_tc_pause>] [-page_start_number <page_start_number>] [-record_out <record_out>]
-       [-remove_cache_request <remove_cache_request>] [-remove_cookie <remove_cookie>] [-sampler_start_number
-       <sampler_start_number>] [-use_lrwr_infos <use_lrwr_infos>]
+usage: io.github.vdaburon.jmeter.har.HarForJMeter [-add_pause <add_pause>] [-add_result_tree_record
+       <add_result_tree_record>] [-external_file_infos <external_file_infos>] [-filter_exclude <filter_exclude>]
+       [-filter_include <filter_include>] -har_in <har_in> [-help] -jmx_out <jmx_out> [-new_tc_pause <new_tc_pause>]
+       [-page_start_number <page_start_number>] [-record_out <record_out>] [-remove_cache_request
+       <remove_cache_request>] [-remove_cookie <remove_cookie>] [-sampler_start_number <sampler_start_number>]
+       [-use_lrwr_infos <use_lrwr_infos>]
 io.github.vdaburon.jmeter.har.HarForJMeter
- -add_pause <add_pause>                         Optional boolean, add Flow Control Action Pause after Transaction
-                                                Controller (default true)
- -external_file_infos <external_file_infos>     Optional, csv file contains external infos : timestamp transaction name 
-                                                and start or end
- -filter_exclude <filter_exclude>               Optional, regular expression to exclude url
- -filter_include <filter_include>               Optional, regular expression to include url
- -har_in <har_in>                               Har file to read (e.g : my_file.har)
- -help                                          Help and show parameters
- -jmx_out <jmx_out>                             JMeter file created to write (e.g : script.jmx)
- -new_tc_pause <new_tc_pause>                   Optional, create new Transaction Controller after request ms, same as
-                                                jmeter property : proxy.pause, need to be > 0 if set. Usefully for Har
-                                                created by Firefox or Single Page Application (Angular, ReactJS, VuesJS
-                                                ...)
- -page_start_number <page_start_number>         Optional, the start page number for partial recording (default 1)
- -record_out <record_out>                       Optional, file xml contains exchanges likes recorded by JMeter
- -remove_cache_request <remove_cache_request>   Optional boolean, remove cache header in the http request (default true
-                                                because add a Cache Manager)
- -remove_cookie <remove_cookie>                 Optional boolean, remove cookie in http header (default true because add
-                                                a Cookie Manager)
- -sampler_start_number <sampler_start_number>   Optional, the start sampler number for partial recording (default 1)
- -use_lrwr_infos <use_lrwr_infos>               Optional, the har file has been generated with LoadRunner Web Recorder
-                                                and contains Transaction Name, expected value : 'transaction_name' or
-                                                don't add this parameter
-E.g : java -jar har-for-jmeter-<version>-jar-with-dependencies.jar -har_in myhar.har -jmx_out scriptout.jmx
--new_tc_pause 5000 -add_pause true -filter_include "https://mysite/.*" -filter_exclude "https://notmysite/*"
--page_start_number 50 -sampler_start_number 250
+ -add_pause <add_pause>                             Optional boolean, add Flow Control Action Pause after Transaction
+                                                    Controller (default true)
+ -add_result_tree_record <add_result_tree_record>   Optional boolean, add 'View Result Tree' to view the record.xml file
+                                                    created (default true), record_out must be not empty
+ -external_file_infos <external_file_infos>         Optional, csv file contains external infos : timestamp transaction
+                                                    name and start or end
+ -filter_exclude <filter_exclude>                   Optional, regular expression to exclude url
+ -filter_include <filter_include>                   Optional, regular expression to include url
+ -har_in <har_in>                                   Har file to read (e.g : my_file.har)
+ -help                                              Help and show parameters
+ -jmx_out <jmx_out>                                 JMeter file created to write (e.g : script.jmx)
+ -new_tc_pause <new_tc_pause>                       Optional, create new Transaction Controller after request ms, same
+                                                    as jmeter property : proxy.pause, need to be > 0 if set. Usefully
+                                                    for Har created by Firefox or Single Page Application (Angular,
+                                                    ReactJS, VuesJS ...)
+ -page_start_number <page_start_number>             Optional, the start page number for partial recording (default 1)
+ -record_out <record_out>                           Optional, file xml contains exchanges likes recorded by JMeter
+ -remove_cache_request <remove_cache_request>       Optional boolean, remove cache header in the http request (default
+                                                    true because add a Cache Manager)
+ -remove_cookie <remove_cookie>                     Optional boolean, remove cookie in http header (default true because
+                                                    add a Cookie Manager)
+ -sampler_start_number <sampler_start_number>       Optional, the start sampler number for partial recording (default 1)
+ -use_lrwr_infos <use_lrwr_infos>                   Optional, the har file has been generated with LoadRunner Web
+                                                    Recorder and contains Transaction Name, expected value :
+                                                    'transaction_name' or don't add this parameter
+E.g : java -jar har-for-jmeter-<version>-jar-with-dependencies.jar -har_in myhar.har -jmx_out scriptout.jmx -record_out
+recording.xml -add_result_tree_record true -new_tc_pause 5000 -add_pause true -filter_include "https://mysite/.*"
+-filter_exclude "https://notmysite/*" -page_start_number 50 -sampler_start_number 250
 
-The parameter use_lrwr_infos correspond to checkbox "har created with lrwr". If true set parameter -use_lrwr_infos transaction_name if false don't add this parameter. -
 C:\apache-jmeter\bin>har-convertor-to-jmeter.cmd -har_in "myhar.har" -jmx_out "script_out.jmx" -filter_include "https://mysite.com/.*" -filter_exclude "https://notmysite.com/.*" -add_pause true -new_tc_pause 5000
 
@@ -196,13 +197,16 @@ The maven groupId, artifactId and version, this plugin is in the **Maven Central ```xml io.github.vdaburon har-convertor-jmeter-plugin -5.2 +6.0 ``` ## License Licensed under the Apache License, Version 2.0 ## Versions +Version 6.0 date 2024-09-19, Use new library har-to-jmeter-convertor 6.0 for adding 'HTTP(S) Test Script Recorder' and 'View Results Tree' to view the Record.xml file created. Correct save file no url encoded name. + +Version 5.3 date 2024-09-13, Use new library har-to-jmeter-convertor 5.3 that correct PUT with no parameter, no content and mime-type == null Version 5.2 date 2024-06-20, Use new library har-to-jmeter-convertor 5.2 that correct extract parameters for mime type "form-urlencoded" ended with charset likes "application/x-www-form-urlencoded; charset=xxx" diff --git a/doc/images/har_convertor_tool_gui.png b/doc/images/har_convertor_tool_gui.png index 58f15c5..68fd5b1 100644 Binary files a/doc/images/har_convertor_tool_gui.png and b/doc/images/har_convertor_tool_gui.png differ diff --git a/doc/images/jmeter_script_record_created.png b/doc/images/jmeter_script_record_created.png index 17fbe1e..de49199 100644 Binary files a/doc/images/jmeter_script_record_created.png and b/doc/images/jmeter_script_record_created.png differ diff --git a/pom.xml b/pom.xml index b8beca0..d8b6256 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.vdaburon har-convertor-jmeter-plugin - 5.2 + 6.0 jar Apache JMeter Plugin to convert a HAR file to a JMeter script and Record XML @@ -62,6 +62,7 @@ false + org.apache.jmeter @@ -81,7 +82,7 @@ io.github.vdaburon har-to-jmeter-convertor - 5.2 + 6.0 @@ -170,7 +171,7 @@ --> org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh diff --git a/src/main/java/io/github/vdaburon/jmeterplugins/har/gui/HarConvertorGui.java b/src/main/java/io/github/vdaburon/jmeterplugins/har/gui/HarConvertorGui.java index edc2920..7d00574 100644 --- a/src/main/java/io/github/vdaburon/jmeterplugins/har/gui/HarConvertorGui.java +++ b/src/main/java/io/github/vdaburon/jmeterplugins/har/gui/HarConvertorGui.java @@ -75,6 +75,7 @@ public class HarConvertorGui extends AbstractAction implements private JCheckBox isRemoveCookieCheckbox; private JCheckBox isRemoveCacheRequestHeaderCheckbox; private JCheckBox isUseLrwrTransactionNameCheckbox; + private JCheckBox isAddResultTreeRecordCheckbox; private JButton btConvert; private JButton btConvertAndLoad; @@ -234,8 +235,10 @@ public void actionPerformed(ActionEvent action) { boolean isRemoveCookieHeader = isRemoveCookieCheckbox.isSelected(); boolean isRemoveCacheRequestHeader = isRemoveCacheRequestHeaderCheckbox.isSelected(); + boolean isAddResultTreeRecord = isAddResultTreeRecordCheckbox.isSelected(); boolean isUseLrwrTransactionName = isUseLrwrTransactionNameCheckbox.isSelected(); + String lrwr_info = ""; if (isUseLrwrTransactionName) { lrwr_info = HarForJMeter.K_LRWR_USE_TRANSACTION_NAME; @@ -249,6 +252,7 @@ public void actionPerformed(ActionEvent action) { log.info("fileHarIn=<"+ fileHarIn + ">"); log.info("fileJmxOut=<" + fileJmxOut + ">"); log.info("recordXmlOut=<" + recordXmlOut + ">"); + log.info("isAddResultTreeRecord=<" + isAddResultTreeRecord + ">"); log.info("createNewTransactionAfterRequestMs=<" + createNewTransactionAfterRequestMs + ">"); log.info("isAddPause=<" + isAddPause + ">"); log.info("regexFilterInclude=<" + regexFilterInclude + ">"); @@ -260,7 +264,7 @@ public void actionPerformed(ActionEvent action) { log.info("externalFileInfoIn=<" + externalFileInfoIn + ">"); log.info("****************************************"); - HarForJMeter.generateJmxAndRecord(fileHarIn, fileJmxOut,createNewTransactionAfterRequestMs,isAddPause, isRemoveCookieHeader, isRemoveCacheRequestHeader, regexFilterInclude, regexFilterExclude, recordXmlOut, pageStartNumber, samplerStartNumber, lrwr_info, externalFileInfoIn); + HarForJMeter.generateJmxAndRecord(fileHarIn, fileJmxOut,createNewTransactionAfterRequestMs,isAddPause, isRemoveCookieHeader, isRemoveCacheRequestHeader, regexFilterInclude, regexFilterExclude, recordXmlOut, pageStartNumber, samplerStartNumber, lrwr_info, externalFileInfoIn, isAddResultTreeRecord); log.info("After HarForJMeter.generateJmxAndRecord"); btConvert.setEnabled(true); @@ -383,6 +387,9 @@ private JPanel createCheckbox() { JLabel isRemoveCacheHeaderLabel = new JLabel("(Optional) Remove cache header in the http request (default true because add a Cache Manager)"); isRemoveCacheRequestHeaderCheckbox= new JCheckBox("",true); + JLabel isAddResultTreeRecordLabel = new JLabel("(Optional) Add 'View Result Tree' to view the recording xml file created (default true)"); + isAddResultTreeRecordCheckbox= new JCheckBox("",true); + JLabel isUseLrwrTransactionNameLabel = new JLabel("(Optional) HAR was generated with LoadRunner Web Recorder and Transaction Names (default false)"); isUseLrwrTransactionNameCheckbox= new JCheckBox("",false); @@ -395,6 +402,9 @@ private JPanel createCheckbox() { panel.add(isRemoveCacheHeaderLabel); panel.add(isRemoveCacheRequestHeaderCheckbox); + panel.add(isAddResultTreeRecordLabel); + panel.add(isAddResultTreeRecordCheckbox); + panel.add(isUseLrwrTransactionNameLabel); panel.add(isUseLrwrTransactionNameCheckbox);