I would strongly advise against reading the html unless this is your base line ("expected results").
Your better off verifying the length via the gui, as this is what you are testing. For example what happens if the html code has an error and the line that is to set the length is never interpreted?
Slow but effective:
public function getTextCapacity( editObject)
auto count = 1; #int
auto text = ""; #string
edit_set( editObject, ""); # Make sure field is empty
do # Until mismatch in input and length
type(((count % 2)?"X":"O" ));
if((length(text)) != count++)
break; # Out of do/while()