Multiple items selection
Home › Forums › Ask Expert › Multiple items selection
- This topic has 4 replies, 2 voices, and was last updated 1 year, 10 months ago by Sasha ZAP.
-
AuthorPosts
-
February 2, 2023 at 2:26 pm #51805Marco MalziottiParticipant
How to capture in the “Repository Explorer” a multiple selection menu like the one indicated in the field of the “Search Booking” screen?
I am sending my proof attached (see “MultipleChoiceFromList” view).
Note that as the number of selected items varies, the distance between the “listItem” object and the “lblLabel” changes!
How do I add an entry?
In the attached example, I manage to add the first one but not the following ones.
How do I delete one of the selected items?
In the attached example, I am not able.
Thank you.Marco Malziotti
link will expire on 14-01-2023:
https://octospa-my.sharepoint.com/:f:/g/personal/m_malziotti_octotelematics_com/Ev9sTOqalghJu0HmMCmYkKMBT5IWDtNfs9qcyHzHkqSLKQ?e=K4z5K8February 3, 2023 at 12:25 am #51815Sasha ZAPModeratorHello Marco,
I’ve tried to execute your test but got the “403 Forbidden” page error.
Regarding your questions, please check my answers(Because I could not execute the test my answers are only based on the attached script and the final test’s results):
1. How to capture in the “Repository Explorer” a multiple selection menu like the one indicated in the field of the “Search Booking” screen?
Basically your way of doing it is a common way to do so.
2. I am sending my proof attached (see “MultipleChoiceFromList” view).
Note that as the number of selected items varies, the distance between the “listItem” object and the “lblLabel” changes!
I recommend to create a list which contains a lot more rows, this also includes 1 or 2 rows which will be right under the “lblLabel” object – In such case the list will be always below the “lblLabel” object.
3. How do I add an entry?
If I understand correctly the question, you are asking if there are extra rows of data in the appeared list and your list is limited to X amount of rows how do you set it to have more rows (And be able to have the newly appeared data)?
If this is the actual question then as you’ve written, the amount of listed values may change. therefore It is best to set the list with the maximum number of possible appeared rows, and in such a list you will always be able to find all newly appeared data.
4. In the attached example, I manage to add the first one but not the following ones.
How do I delete one of the selected items?
If this is a continued #3 question, then the answer is you do not need to delete anything, just keep the same long list (Even with empty rows of data) so it will be able to capture all possible appeared data (If you still want to change the amount or list’s rows you can always do it by updating “Rows” List Property, using the “SetProperty” method).P.S. I’ve attached your testing script with an update of the list I think may work for you, which I’ve also added an Area object around the list to increase the ability to locate the required list(Name of the updated test: “Sasha List Update_multiple-selection.zap”), in the following shared drive link:
https://drive.google.com/file/d/1xz8xSWTc7yblp2NKgor76kM7Hhnd92O9/view?usp=sharing
Hope this helps,
Thanks,
ZAPTEST TeamFebruary 3, 2023 at 10:00 am #51825Marco MalziottiParticipantTo be clearer, here is the video (see “multiple-selection.mp4″ in same link) of the execution steps that I would like to automate with ZapTest.
As you see, when you type something in the field, the list changes accordingly.
Match times of video / script line:
4” Type Datatable.Value(“typeVale1″) – line 33
5” ClickRow Datatable.Value(“searchValue1″) – line 36
7” Type Datatable.Value(“typeVale2″) – line 38
9” ClickRow Datatable.Value(“searchValue2″) – line 39
11” Type Datatable.Value(“typeVale3″) – line 41
13” ClickRow Datatable.Value(“searchValue3″) – line 42
15” Object(“iconRemoveItem”).Click – line 48
Thanks,
Marco MalziottiFebruary 3, 2023 at 10:13 am #51826Marco MalziottiParticipantRunning my attached script I got instead that:
– Although having captured 5 rows for the listItem and presenting only 1 at run time (the one to be selected), ZapTest cannot find it (fail to line 39)!
– Although having set the entire string “CAGLIARI AEREOPORTO” (line 45), ZapTest finds only a part of it “CAGLIARI AEREOP” (see report line 46), and subsequently does not find the correct position of iconRemoveItem, not deleting item “CAGLIARI AEREOPORTO”.
Thanks,
Marco MalziottiFebruary 3, 2023 at 3:40 pm #51844Sasha ZAPModeratorHello Marco,
I understand now the functionality you want to have – Please check my updated “Sasha List Update_multiple-selection.zap” test, in its “ZAP Update” section (Lines #44-#51)”
https://drive.google.com/file/d/1xz8xSWTc7yblp2NKgor76kM7Hhnd92O9/view?usp=sharing
If this will not work for you, maybe add an Area object around the “lblFirstSelectedItem” object (And set the “lblLabel” object as its parent object).
I hope this solves the issue.
Thanks,
ZAPTEST Team -
AuthorPosts
- You must be logged in to reply to this topic.