JMeter - dynamic structure of HTTP request sampler - jmeter

I am trying to test, with JMeter, a HTTP request like that:
<v2:hotelAvailability>
<identification username='${username}' password='${password}'/>
<checkIn>${checkin}</checkIn>
<checkOut>${checkout}</checkOut>
<roomCriterias>
<!-- one or more repetition -->
<room adult="${adult}">
<children>
<!-- zero or more repetition -->
<child age="${childAge}"/>
</children>
</room>
</roomCriterias>
</v2:hotelAvailability>
As you can see, the structure of the request is dynamic: could be one room or more than one, could be one child or none. I would like to do something like this, but I don't know how to do it with JMeter:
<v2:hotelAvailability>
<identification username='${username}' password='${password}'/>
<checkIn>${checkin}</checkIn>
<checkOut>${checkout}</checkOut>
<roomCriterias>
foreach(${room}:${roomsNb})
<room adult="${room.adult}">
<children>
foreach(child:${children})
<child age="${child.childAge}"/>
end foreach
</children>
</room>
end foreach
</roomCriterias>
</v2:hotelAvailability>
I also want all variables, like ${checkin} or ${roomsNb}, to be read from a csv file. Is this possible?
More specific, if roomsNb=2 than the request will look like that:
<v2:hotelAvailability>
<identification username='${username}' password='${password}'/>
<checkIn>${checkin}</checkIn>
<checkOut>${checkout}</checkOut>
<roomCriterias>
<room adult="${adult}">
<children>
<child age="${childAge}"/>
</children>
</room>
<room adult="${adult}">
<children>
<child age="${childAge}"/>
</children>
</room>
</roomCriterias>
</v2:hotelAvailability>

I have created a solution for your problem.
Go though the below link and let me know if it suits you.
https://funwithjmeter.blogspot.com/2018/12/handle-dynamic-body-in-jmeter.html

Related

Magento 1.9.2.2 acees denied in vendor login with supee patches?

I am new in magento in 1.9.2.2 my market place extension vendor login access denied in vendor login i have found there is some acl problem but i am not able to change it Please help
<acl>
<resources>
<admin>
<children>
<medma>
<title>Medma</title>
<children>
<marketplace>
<title>Market Place</title>
<children>
<pending_products>
<title>Pending Products</title>
</pending_products>
<manage_vendors>
<title>Manage Vendors</title>
</manage_vendors>
<reviews_ratings>
<title>Reviews and Ratings</title>
<children>
<pending_reviews>
<title>Pending Reviews</title>
</pending_reviews>
<all_reviews>
<title>All Reviews</title>
</all_reviews>
<manage_ratings>
<title>Manage Ratings</title>
</manage_ratings>
</children>
</reviews_ratings>
<manage_verification>
<title>Verification</title>
<children>
<manage_type>
<title>Manage Types</title>
</manage_type>
</children>
</manage_verification>
<configuration>
<title>Configuration</title>
</configuration>
</children>
</marketplace>
</children>
</medma>
<vendor>
how to I change acl property in my extension thanks for advance
If you don't want to make any changes for ACL then you can simply write below code in respective controllers.
protected function _isAllowed()
{
return true;
}

Magento admin menu link not showing up

I have created 2 modules (A and B) in Magento. Each of these modules are managed from the admin section.
I tried creating a menu link under cms(menu) in the admin section for each module by writing the following configuration in modules' config files
Module A>etc>config.xml
<adminhtml>
<menu>
<a module="A">
<title>A</title>
<sort_order>100</sort_order>
<children>
<items module="A">
<title>Manage A</title>
<sort_order>0</sort_order>
<action>a/adminhtml_a</action>
</items>
</children>
</a>
</menu>
<adminhtml>
Module B>etc>config.xml
<adminhtml>
<menu>
<b module="B">
<title>B</title>
<sort_order>100</sort_order>
<children>
<items module="B">
<title>Manage B</title>
<sort_order>1</sort_order>
<action>b/adminhtml_b</action>
</items>
</children>
</b>
</menu>
<adminhtml>
However only the link for Module B shows up under CMS menu. How can I show both links?
the following worked
Module A>etc>config.xml
<menu>
<cms>
<children>
<a module="A">
<title>A</title>
<sort_order>5</sort_order>
<children>
<items module="A">
<title>Manage A</title>
<sort_order>0</sort_order>
<action>A/adminhtml_a</action>
</items>
</children>
</a>
</children>
</cms>
</menu>
Module B>etc>config.xml
<menu>
<cms>
<children>
<b module="B">
<title>B</title>
<sort_order>6</sort_order>
<children>
<items module="B">
<title>Manage B</title>
<sort_order>0</sort_order>
<action>B/adminhtml_b</action>
</items>
</children>
</b>
</children>
</cms>
</menu>

How do I add a submenu to an existing menu in Magento?

My existing code creates a menu that looks like this.
But I want a menu that is a sub-menu of the Catalog menu.
Here is my existing code in adminhtml.xml
<?xml version="1.0" ?>
<config>
<menu>
<mycustom_menu translate="title" module="brands">
<title>My Custom Menu Item</title>
<sort_order>300</sort_order>
<children>
<!-- child items go here -->
<subitem translate="title" module="brands">
<title>Manage Brands</title>
<sort_order>10</sort_order>
<action>adminhtml/mycustom_controller/</action>
</subitem>
</children>
</mycustom_menu>
</menu>
<acl>
<resources>
<admin>
<children>
<mycustom_menu translate="title" module="brands">
<title>My Custom Menu Item</title>
<sort_order>300</sort_order>
<children>
<subitem translate="title" module="brands">
<title>Subitem</title>
<sort_order>10</sort_order>
</subitem>
</children>
</mycustom_menu>
</children>
</admin>
</resources>
</acl>
</config>
Instead of using <mycustom_menu> you need to re-use the nodename that was used in the adminhtml.xml of the catalog module. That name is catalog.
So your XML should look like:
<?xml version="1.0"?>
<config>
<menu>
<catalog>
<children>
<your_subitem>
<title>Subitem 1</title>
<sort_order>10</sort_order>
<action>adminhtml/your_action</action>
</your_subitem>
</children>
</catalog>
</menu>
<acl>
<resources>
<admin>
<children>
<catalog>
<title>Subitem 1</title>
<sort_order>10</sort_order>
</catalog>
</children>
</admin>
</resources>
</acl>
</config>
For example to add submenu in customer tab:
<menu>
<customer>
<children>
<vendor module="yourmodule">
<title>Your Title</title>
<sort_order>0</sort_order>
<action>admin_yourmodule/adminhtml_yourmoduleaction</action>
</vendor>
</children>
</customer>
</menu>

How to link Magento admin menu to role resources

Here's the situation:
I would like to add a Menu in the Magento backend navigation menu.
I accomplished this by adding the following code in app/etc/config.xml:
<adminhtml>
<menu>
<example translate="title" module="adminhtml">
<title>Inventory</title>
<sort_order>110</sort_order>
<children>
<set_time>
<title>Set It!</title>
<action>helloworld/index/goodbye</action>
</set_time>
</children>
</example>
</menu>
The problem is I can't include this menu in the permission->role resources so I can't assign this to a specific user.
How do I include this menu in the permission->role resources?
Thank you and more power!
You need to tell magento that you want your new menu position to be visible in the permission tree. To do this you have to add an ACL section to your configuration data. Put this inside your module's config.xml file:
<acl>
<resources>
<admin>
<children>
<example>
<title>Inventory</title>
<sort_order>110</sort_order>
<children>
<set_time>
<title>Set It!</title>
<sort_order>0</sort_order>
</set_time>
</children>
</example>
</children>
</admin>
</resources>
</acl>
thanks.. I got it to work with a few tweakings..
<adminhtml>
<acl>
<resources>
<admin>
<children>
<helloworld_options translate="label" module="helloworld">
<title> MENU</title>
<sort_order>999</sort_order>
<children>
<hello_children1>
<title> RELATION</title>
<sort_order>10</sort_order>
</hello_children1>
<hello_children2>
<title> MACHINE</title>
<sort_order>20</sort_order>
</hello_children2>
<hello_children3>
<title> INVOICE</title>
<sort_order>30</sort_order>
</hello_children3>
</children>
</helloworld_options>
<system>
<children>
<config>
<children>
<helloworld_options translate="label" module="helloworld">
<title> MENU</title>
</helloworld_options>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
this will display the following menu with sub menus in the backend.. plus this can be configured in the role resources.. :)

How do you move an admin menu item in Magento

I currently have an extension that I created and it currently sits inside of its own top level menu. I would like to move it so that the item would appear inside of the Customers menu. Does anyone know how to do this?
It looks like this is handled inside the extensions config.xml file. The code that I have for it right now is as follows:
<menu>
<testimonials module="testimonials">
<title>Testimonials</title>
<sort_order>71</sort_order>
<children>
<items module="testimonials">
<title>Manage Items</title>
<sort_order>0</sort_order>
<action>testimonials/adminhtml_testimonials</action>
</items>
</children>
</testimonials>
</menu>
I tried changing the title element to Customers and it just created a duplicate Customers menu.
Try this:
<menu>
<customer>
<children>
<testimonials module="testimonials">
<title>Testimonials</title>
<sort_order>71</sort_order>
<children>
<items module="testimonials">
<title>Manage Items</title>
<sort_order>0</sort_order>
<action>testimonials/adminhtml_testimonials</action>
</items>
</children>
</testimonials>
</children>
</customer>
</menu>

Resources