Forum Discussion

Manojrsr's avatar
Manojrsr
Contributor
7 years ago
Solved

How to Get Text from WebPages

I need to get Text from Message Alert box, and i need to verify the same in my test.

 

Attached Properties of objects and script i have written to get text

aqObject.CheckProperty(Aliases.browser.pageProviderAgency2.formAspnetform.table.table.cell.table.table.cell.tableTabbg.table.textnodeLblpaymentdetailsconfirm, "contentText", cmpEqual, "You need to purchase a subscription in order to access Referral Valet. Do you wish to purchase a subscription now?");

 

But While Running Script, Actual Text is mismatched with Expected Text.

  • Right click and Click Edit on your object in Name mapping.

     

    Then click on ObjectIdentifier property in right side and click arrow to get into your property as like below

     

    updatenamemapping.PNG

18 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    In AUT, Is there any other alert popup with actual text which is displayed instead of your expected one?

     

    And also, See the captured picture in the log whether your AUT displayed the right alert popup. 

    • Manojrsr's avatar
      Manojrsr
      Contributor

      Hi,

       

      In AUT,While Running Script , im getting Expected Pop up only.

      But Actual Result Varies, Dont Know Exact Solution.please help on this

      • shankar_r's avatar
        shankar_r
        Community Hero

        This could be multiple labels in the background of your Alert popup.

         

        You can try below steps to confirm this,

        1. Run your existing script then you will get the popup which TC fails the validation.
        2. use Object Spy to locate the label and see what is your label string. If you are getting same mismatched string then Go to browser and see what are the child items of that Alert mapping