This is a migrated thread and some comments may be shown as answers.
How to find label based on pseudo element
1 Answer 13 Views
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 21 Apr 2021, 04:16 AM

Hi,

I am new to Telerik Test Studio.

I am trying to figure out how to find a label if it's pseudo element ::before or ::after contains specific CSS class (.custom-control-input:checked).

Please see the screenshot attached.

If I locate required element as below:

var label = div.Find.ByAttributes<HtmlControl>("class=~custom-control-label");

I can't find the way to examine its pseudo elements. There is no trace of .custom-control-input:checked

Please advise

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 21 Apr 2021, 03:34 PM

Hi Alex,

Thank you for contacting us with this query. 

To be honest with you, I am not familiar in depth with the pseudo elements in CSS, but as far as I understand these are only listed in the style section of the html and then are applied without indication in the actual element. Please, correct me if I have misunderstand how the pseudo elements are being used.

If this is so, then the you can only verify the actual style that the element uses in the displayed page. That said, you can explore the advanced verification options in the Advanced Recording Tools and if these will fit your needs. 

Do not hesitate to get back to me in case you have any further topic for this discussion. Thank you for your cooperation in advance. 

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Asked by
Alex
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or