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

Check if is selected

Check if is selected

Home Forums Ask Expert Check if is selected

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

      Good evening
      I only have to select some items on a page where I don’t know a priori which items are selected.
      So I have to ask myself first if an item is already selected or not.
      How can I do it?
      If I run the script with the screen “c2c – View customer selected.png” I get the report “Results – is item selected – 02-16-22 02-59-17.zre”
      If I run the same script with the screen “c2c – View customer unselected.png” I get the report “Results – is item selected – 02-16-22 03-00-01.zre”.
      In both cases I read the message: ‘View customer’ is to select!
      Actually I wanted the script in the first case to return the message : ‘View customer’ already selected!
      Thank you.

      Marco Malziotti

      #32895
      Sasha ZAP
      Moderator

        Hello Marco,

        Basically to check if a certain checkbox or radio-button was checked you can set its object “Recognition Type” property as “OCR (Partial)”, and set its “Text Color” accordingly:
        Then you can use the object’s “GetAverageColorName” method to capture its color name (Or instead use the “CompareAverageColorRGB” to get the color’s number), and if the color is different from its original setting it means the object’s status is different (See attached “isitemselected_ZAP Team.zap” script, lines #:11-12).

        Hope this helps.

        Thanks,
        ZAPTEST Team

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