In this post, we will take a look on doing CSS Verification of HTML element in Test Studio. You can put verification on CSS while recording the test. Let us say on following page you want to do CSS verification on highlighted element.
While recording the test click on Enable or Disable Hover.
After selecting that select element and click on blue bubble. Select “Build Verification”
In DOM Explorer, select HTML element and click on Style.
In Style, you have option to select
- Computed Style
- Inline Style
You can create verification step by choosing different options from the drop down.
Let us say you want to create a verification step “Font size of element is 2em”. You can do that selecting Font and Size from drop down.
After selecting value from drop downs click on Validation Rules. You will get a message that “Validation Passed”
After closing DOM Explorer and stopping the recording, you will find a CSS verification step has been added to the Test Steps.
In this way you can do CSS verification on HTML elements. I hope you find this post useful. Thanks for reading.