Issue with custom checkbox styles

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Lyuba Boerma
Posts: 35
Joined: Mon Apr 01, 2019 12:12 pm

Issue with custom checkbox styles

Post by Lyuba Boerma » Mon Aug 17, 2020 4:06 pm

Hi everybody . i hope somebody can help me to figure it out. we are changing design for our application. And for some reason we have now custom checkboxes. What are not a real checkboxes in a code. It is usually a label element.
If it is clicked it gets " ::before"
if it is unclicked - it doesn't have " ::before "

this ::before is not visible for Ranorex. At least i can not find it. i made a snapshot. but i am not sure that i will help.

i my tests i very often use " set value "checked" to true " or validate that " checked" is true/false .
Maybe you have any idea how to work with this now ?
how for example to validate a status (checked /unchecked) for this element?
Thank you
New Checkbox.rxsnp
(699.53 KiB) Not downloaded yet
ahg9d.png
ahg9d.png (59.25 KiB) Viewed 52 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6181
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Issue with custom checkbox styles

Post by odklizec » Mon Aug 17, 2020 4:16 pm

Hi,

Why don’t you track the Input element instead? From the HTML code it looks like if the input has “checked” option? The “before” string you are pointing at is from checkbox label and not from checkbox itself?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Lyuba Boerma
Posts: 35
Joined: Mon Apr 01, 2019 12:12 pm

Re: Issue with custom checkbox styles

Post by Lyuba Boerma » Mon Aug 17, 2020 4:33 pm

odklizec wrote:
Mon Aug 17, 2020 4:16 pm
Hi,

Why don’t you track the Input element instead? From the HTML code it looks like if the input has “checked” option? The “before” string you are pointing at is from checkbox label and not from checkbox itself?
because it is not always working(( . Sometimes Ranorex complains that item is not visible

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6181
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Issue with custom checkbox styles

Post by odklizec » Mon Aug 17, 2020 5:19 pm

Hi,

Could you please post exact error (entire report) you are getting? And full xpath as you are using it in repository?

I think you might just add WaitForDocumentLoaded before accessing the checkbox. Eventually, add @visible=“true” to the xpath.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration