Request Quote

Multiselect Value Selection in Magento Functional Testing Framework

In this article, I am going to explain how to select multiple values in Magento Functional Testing Framework.

It is not different than any other selection in the Magento functional testing framework, the only different thing is how to take user input. Its selector you can use by any Id or CSS selector or any type of selector you usually use.

Suppose you are writing action group in which you have to select multiple values:

Action Group Command:

<selectOption stepKey="attributeSetId" parameterArray= "['Appointment Booking','Default','Event Booking','Hotel Booking','Rental Booking','Table Booking']"  selector="{{MultiSelectSection.attributeSetId}}"/>

Now I am going to explain all the above keywords:

1. selectOption: selectOption is use to select values for dropdown and multi-select operations

2. parameterArray: It is the main part in multi-selection. In parameterArray you have to give value or name of all those multi-select values you want to select in multi-select operation.

Let see below HTML example, you will find such type of HTML code when you will inspect multi-select field:

<option value="9">Appointment Booking</option>
<option value="4">Default</option>
<option value="11">Event Booking</option>
<option value="12">Hotel Booking</option>
<option value="10">Rental Booking</option>
<option value="13">Table Booking</option>

In the above code for parameterArray either you can use value i.e. 4, 11, 12, 10, 13 or you can use its label i.e. Default, Event Booking, Hotel Booking, Rental Booking, and Table Booking

But value sometime will generate dynamically then your code may be the break, then in this case options label is preferable to use i.e. Default, EventBooking, Hotel Booking etc.

3. selector = This selector I have used in its section. Now I will explain its section part.

Section Part, Suppose its name is: MultiSelectSection

<element name="attributeSetId" type="select" selector="#marketplace_product_settings_attributesetid"/>

Let see above code keywords explanation:
1. name = “attributeSetId” : It is used in above action group for calling this section element. We call section in selector by sectionName.name i.e. MultiSelectSection.attributeSetId
2. type = “select”: It is the type of selector. For selecting any value we use select type.
3. selector=”#marketplace_product_settings_attributesetid”: In this selector either you can use id, class, name or any selector we usually use to select any element in the Magento functional testing framework

Thanks!

. . .

Comment

Add Your Comment

Be the first to comment.

css.php