fbpx

Get your 6-month No-Cost Opt-Out offer for Unlimited software automation!

Select item in Android list

Select item in Android list

Home Forums Ask Expert Select item in Android list

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32442
    Marco Malziotti
    Participant

      Hi ZAPTEST Team,
      I am facing following issue:
      – In Android platforms after selecting “English” in translate.google.com (see screenshot1.png) is displayed list in screenshot2.png.
      With my finger, scroll the list and select the langauge (if exist). How can I select specific list’s item by name stored in Datatable column “Language” in ZapTest script?
      I read replay at “List object and the UI difference on different OS” topic and study “List and Tables” and “iPhone and Android” tutorial, but I don’t find solution at my issue (list in “iPhone and Android” tutorial fills only one screen and it’s not necessary to scroll the list to select item).
      Can yuo help me?
      Thanks.

      #32443
      Kirill Bulatnikov
      Participant

        Hello Marco. Thanks for using ZAPTEST.

        To perform this action you may create some virtual object, let’s call it “Language”. Prior to perform scrolling you need to set the property “Text” of this object to the value from datatable (or you can hard-code it)
        [i]
        Application(“Application”).View(“View”).Object(“Language”).SetProperty “Text”, DatatableValue(“A”)[/i]

        And in the next step apply “ScrollTo” method to this object

        Application(“Application”).View(“View”).Object(“Language”).ScrollTo

        Thus ZAPTEST will scroll the list until it find the object with text you need (if it’s exists, otherwise the step will report failure).

        Hope that helps.

        Thanks.
        Kirill,
        ZAPTEST Team.

        #32464
        Marco Malziotti
        Participant

          Thank
          All works fine if “A” is below in list, but if “A” is above ScroolTo function scrool list in bottom and not find “A”.
          In posted screenshot I want find “+380” prefix thath is present above selected “+39”; but ScrollTo scroll bottom.
          Regards.

          Marco Malziotti

          Attachments:
          #32465
          Sergey ZAP
          Keymaster

            Hello Marco!
            If I get it correct, this list does not open with top items, but rather random.
            In you case you can first scroll it up to the very top, and then scroll down to the desired item.
            Example:
            Application(“Application”).View(“View”).Object(“top_item”).ScrollTo 80
            Application(“Application”).View(“View”).Object(“item_to_select”).ScrollTo

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.