Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
468
Unable to capture error text
posted

I am using QTP version 11.00 with .NET and VB add-ins and I have TestAdvantage version 2008 vol 2 installed. The application is a VB .NET application developed with NetAdvantage version 2008, vol 2. The control is an Error Provider control that displays a red exclamation point that displays error text when the user hovers over it with the mouse. I tried to use GetErrorProviderText but only returned an empty Msgbox. Has anyone run across and issue like this and if so, how did you handle it?

I have attached a sample application that illustrates the error text.

Thanks in advance

Fred

Sample.zip
Parents
  • 7695
    Offline posted

    Hi Fred,

       Short answer, unfortunately there is no way to get the error text in the sample provided without some modification. The error provider is component that extends the functionality of a control, and QTP primarily only interacts with controls. Since the value is only in the component and not in the control or window, the value cannot be validated directly. The best solution for something like this that we can offer is to set a property on the control with the value of the text at the same time you set the error provider text. Something like :
    textEditor.Tag = "This text editor has error"

    which you can then access in the QTP script via:

    msgbox SwfWindow("QTP Error Provider").SwfObject("textEditor").GetNAProperty("Tag")

Reply Children
No Data