Forum Discussion

whuang's avatar
whuang
Regular Contributor
4 years ago

How can I get rid of this warning message?

Hi there,

 

I have a string to enter into a text field, and I know the string is too long and is going to be truncated, and that is what I want to test, but this triggers a warning message in TC "the text specified in the edit box has been truncated, since it was too long". Is there anyway I can get rid of the warning and make it not to be triggered?

 

Thanks in advance!

  • Hi,

     

    Use OnLogWarning event handler and block this exact message (maybe, for this exact test) from been posted to test log.

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Use OnLogWarning event handler and block this exact message (maybe, for this exact test) from been posted to test log.

     

    • whuang's avatar
      whuang
      Regular Contributor

      Thanks for the suggestion. I know exactly where and when the warning will show up, so I was doing it in another way by using LogParams.Locked = True directly right before entering the string, but I was getting "Object required: 'LogParams'", do you see why I was getting it?

       

      LogParams.Locked = True

      Obj.SetText String

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        "Object required: 'LogParams'", do you see why I was getting it?

        Because LogParams object is accessible from event handler code only.

         

        In your case you may also consider Log.Enabled property.