I am currently attempting to determine if text is displayed in a bold format within a free text area. However, when I try to select the element, I am unable to verify the text portion.
I attempted to use .getCSSValues based on the provided link suggestion for duplicates, but this method does not retrieve the 'text' from the freetext area, since it is in a string format. The freetext area, being an element, poses some challenges.
IWebElement isBold = _driver.FindElement(By.TagName("p"));
isBold.GetCssValue("font-weight");
Unfortunately, the font weight consistently returns "400" regardless of whether or not the text is actually displayed in a bold typeface.
The HTML code snippet is as follows:
<div class="fr-element fr-view" dir="auto" contenteditable="true" aria-disabled="false" spellcheck="true"><p style=""><strong>TEXT</strong></p></div>
Given that the selected text should be displayed in "700" font weight when bold, this result seems unexpected.