I have an object which has the ObjectType as Panel. It consists a number of card-blocks with text and the ObjectType is Panel for each of them. I need to verify if the card-blocks containing text are getting wordwrapped.
For this, I first detected the card-blocks containing the text and made use of the WordWrap method. But it is throwing me an error.
Could someone please let me know where am I going wrong and suggest how to resolve this issue?
The text is just a string with more than 50 characters. I am passing this string to the textbox using the Keys method. After adding this text, I am checking in the panel where it is displayed, whether the text is word wrapped ot not.
var str = "Any string which is more than 50 characters"
var textArea = obj.FindChild(["ObjectType", "className"], ["Textarea", "noteText"], 5);
//Click on Add button to add the text
var textPanel = obj.FindChild("ObjectType", "className"], ["Panel", "card-text"], 5);
var bool = textPanel.WordWrap;
I am very new to TestComplete, so I don't know if my approach is right or not. I would really appreciate if you could provide me your inputs.
What is the error message you're getting?
According to documentation the
WordWrap property just specifies whether the multi-line component wraps its text to fit the component’s width.
In your case you need to check that your input element has a MaxLength property == 50. That's enough as I think.
However you can addittionally obtain the result after the text was inputed and check it's length.
I am getting the error saying "Unable to find the object WordWrap".
I need to verify if the string which is given as an input is wrapping its text to fit the component's width. Here, I would be mainly checking the word wrapping feature. The text wraps when there are more number of characters, that is the reason I mentioned length as 50 earlier.
Did you explore properties of your textPanel? Using Object Spy or Object Browser.
Does it have WordWrap property at all? Here you can find how to do it >>