Forum Discussion

Moulya_p's avatar
Moulya_p
Occasional Contributor
6 years ago

How to verify word wrapping in a panel which consists of blocks containing text?

Hello Everyone,

 

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?

7 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    Can you provide your text sample and the code you are using?

    • Moulya_p's avatar
      Moulya_p
      Occasional Contributor

      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);

      textArea.Keys(str);

      //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.