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
86
GetVisibleText
posted

Hi,

I am using the following code in QTP10 with TestAdvantage 9.1 CLR2:

searchCrit = SwfWindow("Traffic Volume Information").SwfObject("Search Criteria").GetVisibleText

Each time I execute the code the text that is assigned to searchCrit is different... does anyone know what would cause this or if there is anymore information I can provide to help.

Thanks

Parents
No Data
Reply
  • 1040
    Suggested Answer
    posted

    Try using "GetROProperty ("Text")" instead of "GetVisibleText".

    I don't know if this explains your issue, but according to the QTP Help, "The GetVisibleText method may behave differently in different run sessions depending on the operating system version you are using, service packs you have installed, other installed toolkits, the APIs used in your application, and so on.  Therefore, when possible, it is highly recommended to use the GetROProperty method or the Object property to retrieve the value of the text (or equivalent) property from an object in your application instead of using the GetVisibleText method."

    I hope this helps.

Children
No Data