Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select div with pseudoelement ::after in testcafe

I need to click on div with pseudo element ::after.

Div itself is invisible, but after hovering on another element, the div::after append icon at the end of div which I need to click.

How can I create a selector for div::after?

I can perform click in console with jQuery, but I can't do it in testcafe, because I get

Error:'actionElementIsInvisibleError'.

Use selector .more-options::after is not working

like image 331
valen-tina Avatar asked Dec 06 '25 16:12

valen-tina


1 Answers

You have to simulate yourself the hovering effect by 'patching' the style of the targeted div. In other words you have to make it visible by calling a client function that will change the div style. You may find a code sample here : tc-client-function-set-style-attribute

like image 193
hdorgeval Avatar answered Dec 09 '25 21:12

hdorgeval



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!