Skip to content

Commit 79cc520

Browse files
committed
Add: Folder implementation
1 parent 1307124 commit 79cc520

File tree

8 files changed

+27
-191
lines changed

8 files changed

+27
-191
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"id": "asp",
3-
"description": "creating rules for dotnet",
2+
"id": "myrules",
3+
"description": "1.0",
44
"version": "1.0",
55
"components": "com.blazemeter.jmeter.correlation.siebel.SiebelCounterCorrelationReplacement",
66
"responseFilters": "text/html",

ASP.NET/myrules-repository.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"myrules": {"versions": ["1.0"]}}

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This is a simple Python utility which will help you to convert your LoadRunner C
1919

2020
* LoadRunner Correlation Rules (*.cor)
2121
* JMeter Plugin Manager w/ Blazemeter's Correlation Recorder plugin
22-
* Python
22+
* Python 🐍
2323

2424
## How to use this repository? 🏃‍♂️
2525

@@ -34,3 +34,18 @@ e.g. `python app.py -f LR.cor`
3434

3535
![Output](/assets/Output.jpg)
3636

37+
## Aftermath 🌪
38+
39+
After generating the JSON files, you have to follow the below steps to utilize it in JMeter.
40+
41+
* Create a
42+
43+
## Tested with 🔨
44+
45+
This utility has been tested with:
46+
47+
* Micro Focus LoadRunner 2020 SP 2
48+
* Apache JMeter 5.3
49+
* Blazemeter Correlation Recorder 1.1
50+
51+

app.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def main():
5757
# Create Rules
5858
fetch_rules(root, group_name,get_id, get_version)
5959
# Create Repository File
60-
create_repository(get_id, get_version)
60+
create_repository(get_id, get_version, group_name)
6161

6262
# Reverting the file name
6363
lr_cor_file = lr_cor_file_renamed
@@ -68,7 +68,7 @@ def main():
6868
except FileNotFoundError as e:
6969
print_message(e, message_color="red")
7070

71-
def create_repository(get_id, get_version):
71+
def create_repository(get_id, get_version, group_name):
7272
"""
7373
Creating a repository for the rules
7474
"""
@@ -79,8 +79,8 @@ def create_repository(get_id, get_version):
7979
]
8080
}
8181
}
82-
repository_file_name = get_id + '-repository.json'
83-
82+
repository_file_name = group_name + '/' + get_id + '-repository.json'
83+
os.makedirs(os.path.dirname(repository_file_name), exist_ok=True)
8484
with open(repository_file_name,"w+") as f:
8585
json.dump(data, f)
8686
f.close()
@@ -111,8 +111,8 @@ def create_jmeter_rule(group_name,get_id, get_description, get_version, get_comp
111111
"repositoryId": "local"
112112
}
113113

114-
json_file_name = get_id + '-' + get_version + '-template' + '.json'
115-
114+
json_file_name = group_name + '/' + get_id + '-' + get_version + '-template' + '.json'
115+
os.makedirs(os.path.dirname(json_file_name))
116116
# Create JSON File
117117
with open(json_file_name,"w+") as f:
118118
json.dump(data, f)
@@ -144,9 +144,9 @@ def fetch_rules(root, group_name, get_id, get_version):
144144
regex = "(.+?)"
145145
# Complete Regex
146146
full_regex = corr_extractor_lb + regex + corr_extractor_rb
147-
json_file_name = get_id + '-' + get_version + '-template' + '.json'
147+
json_file_name = group_name + '/' + get_id + '-' + get_version + '-template' + '.json'
148148
# Adding each rule to the json
149-
add_rules_to_json(json_file_name, rule_name,full_regex)
149+
add_rules_to_json(json_file_name, rule_name, full_regex)
150150
#print(full_regex)
151151

152152
return

asp-repository.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

aspnet-1.0-template.json

Lines changed: 0 additions & 178 deletions
This file was deleted.

aspnet-repository.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/Output.jpg

-25.1 KB
Loading

0 commit comments

Comments
 (0)