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

Scroll to select last item in combo box

Scroll to select last item in combo box

Home Forums Ask Expert Scroll to select last item in combo box

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

      How can I select the last item in the list in the “Type” combo box?
      The Scroll function (line 136) doesn’t seem to work, maybe I didn’t understand how to use it.

      Link expires 3/4/2023:
      https://octospa-my.sharepoint.com/:f:/g/personal/m_malziotti_octotelematics_com/EkTJlbEGiv1FmIw1TT1hLcwBcgBCjmMMoaMLW7ESwwGCKQ?e=ScBxNk

      Thank you.

      Marco Malziotti

      #52776
      Sasha ZAP
      Moderator

        Hello Marco,
        Basically there are 3 ways you can select the required string from a drop-down list – Please check the updated script I’ve uploaded to the following shared directory (Starting from line #136):
        https://drive.google.com/file/d/1OwpCEeIf7mSJrbqThKM-6QzU5JwydpwK/view?usp=sharing

        Hope this will help.
        Thanks,
        ZAPTEST Team

        #52800
        Marco Malziotti
        Participant

          Thank you for your quick answer. The first method works. The second method does not find the item (for example the latest “SKODA CZ”) even in the second list and returns an error. Thank you.

          Marco Malziotti

          #52802
          Sasha ZAP
          Moderator

            Thanks Marco.
            In the second option I forgot to add some of the following coding lines:
            ‘2. Create 2 lists’ objects
            Application(“C2C”).View(“CustomerContract-Type”).Object(“lblType”).Object(“txtItemType”).Click
            intRowNum = Application(“C2C”).View(“CustomerContract-Type”).Object(“lblType”).List(“listContract1”).FindRow contractType
            If intRowNum > 0 Then
            Application(“C2C”).View(“CustomerContract-Type”).Object(“lblType”).List(“listContract1”).ClickRow intRowNum
            Else
            Zap.Keyboard.KeyPress Zap.Keys.Down
            Zap.Keyboard.KeyPress Zap.Keys.Down
            Zap.Keyboard.KeyPress Zap.Keys.Down
            intRowNum = Application(“C2C”).View(“CustomerContract-Type”).Object(“lblType”).List(“listContract1 2”).FindRow contractType
            Application(“C2C”).View(“CustomerContract-Type”).Object(“lblType”).List(“listContract1”).ClickRow intRowNum
            End If

            Maybe now it will work.
            Because I could not execute the app in order to make #2 option valid you must know the following:
            – The 2 List objects must cover the entire rows of the drop-down list (Maybe you’llneed even a third List object todo such).
            – Make sure to click on the “txtItemType” top object to open the drop-down list (Or find other way toopen the list), and using the “Zap.Keyboard.KeyPress Zap.Keys.Down” command emulate the keyboard arrow down key to scroll to the begining of the next List object.
            Hope this makes sense.

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