Forum Discussion

jerkins's avatar
jerkins
Occasional Contributor
5 years ago
Solved

Capturing Pseudo Elements

Hi Team, Is there a way to capture Pseudo elements using TestComplete? I have '::after' in my code and I have to capture it to read the Computed Style of it. Now, how do I capture ::after ?
  • jerkins's avatar
    jerkins
    5 years ago

    Hi Tanya,

    Thanks for the reply. I figured out the solution myself which is pasted below.

    //object is the node inside which pseudo element is available

     

    var window = object.ownerDocument.defaultView;

    var style = window.getComputedStyle(object,":after");

    var computedStyle = style["content"];