Check if is selected
- This topic has 1 reply, 2 voices, and was last updated 3 years ago by
Sasha ZAP.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Ask Expert › Check if is selected
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
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
Already have an account? Login
Check you SPAM folder if you do not see the email.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |