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 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #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 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.

        Virtual Expert

        ZAPTEST

        ZAPTEST Logo