Menu item selection – reused code2
Home › Forums › Ask Expert › Menu item selection – reused code2
- This topic has 5 replies, 2 voices, and was last updated 1 year, 4 months ago by Sasha ZAP.
-
AuthorPosts
-
December 12, 2022 at 12:40 pm #47735Marco MalziottiParticipant
Good morning
How can I select “Select all” or “Milano Stazione Centrle” in the “Pickup DMS” or “Drop off DMS” fields of the SM-PromoUpdate view?
I tried both with object of type list (listItem) and with object of type area (areaList) but without success.
Note that not all selectable items in the list are displayed on click in the “Pickup DMS” or “Drop off DMS” field (see “Milano Stazione Centrle”).
I use ZapTest 22.6.4 free version.
I attachet script, datatable and report at following link (expired at 12/19/2022):
https://octospa-my.sharepoint.com/:f:/g/personal/m_malziotti_octotelematics_com/Egrx4thaBUBAmC8y3mtsAjUBVzAsFWccOH7IkSAQTBCRnw?e=In3tYMThanks for your help.
Marco MalziottiDecember 19, 2022 at 7:37 am #47944Sasha ZAPModeratorHello Marco,
Can you please add the files again? It appears your files’ upload link got expired.
I’m sorry about this.
Thanks,
ZAPTEST TeamDecember 21, 2022 at 3:43 pm #48012Marco MalziottiParticipantNew link expire 12/29/2022
https://octospa-my.sharepoint.com/:f:/g/personal/m_malziotti_octotelematics_com/Egrx4thaBUBAmC8y3mtsAjUBVzAsFWccOH7IkSAQTBCRnw?e=TdeFIg
Thanks.Marco
December 21, 2022 at 3:50 pm #48013Sasha ZAPModeratorHello Marco,
Thank-you, I’ve managed to open the link now.
I’ll check your issue and reply as soon as possible.
Thanks,
ZAPTEST TeamDecember 22, 2022 at 2:09 am #48016Sasha ZAPModeratorHello Marco,
I’ve tried to execute the test but got a “403 Forbidden” error.Basically in your test I’ve noticed that you tried to use an Area object, which may work for you to find the required line of data, but you did one major mistake:
You cannot set Area’s parent object as a dynamic object which its Properties’ values change during runtime, as you are doing in this command:
Application(“SystemConsole”).View(“MultipleChoiceFromList2”).Object(“lblLabel”).SetProperty “Text”,”Drop off DMS'”
In order ZAPTEST will locate the Area object, its parent object must be a static object which ZAPTEST will recognize quickly in the app, meaning:
The “lblLabel” object must have already in its Text properties the “Drop off DMS'” text BEFORE the test gets executed (You can set a unique “lblLabel” object such as “lblDropofDMSLabel”).Therefore you cannot use the above mentioned command for an Area object’s parent.
But you DO able to set properties’ values during runtime to the Area’s child object – Therefore such command is correct:
Application(“SystemConsole”).View(“MultipleChoiceFromList2”).Object(“lblLabel”).Area(“areaList”).Object(“lblUnselected”).SetProperty “Text”,drfDms
Hope this helps.
Thanks,
ZAPTEST TeamDecember 22, 2022 at 8:06 pm #48027Sasha ZAPModeratorHello Marco,
Regarding the Area object I just wanted to mention the following:
You do have the option to set the Area parent object as a dynamic object (For example, as you’ve coded, by changing its “Text” property during runtime), but this you can do ONLY after executing a command that has a status Area’s parent object + Its related Area object + One of Area’s objects child object, for example:
Application(“SystemConsole”).View(“MultipleChoiceFromList2”).Object(“lblLabel”).Area(“areaList”).Object(“lblUnselected”).Exist
And only after the above command will be executed you can execute a command such as:
Application(“SystemConsole”).View(“MultipleChoiceFromList2”).Object(“lblLabel”).SetProperty “Text”,”Pickup DMS”
Hope this helps.
Thanks,
ZAPTEST Team -
AuthorPosts
- You must be logged in to reply to this topic.