SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Feb 2003
    Posts
    533
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Validating long text string?

    Below is the text that is displayed in the page
    "PALS - REVIEW Welcome, Rita Pcosigner Account Number: 201961295 Log Out E-sign Your Application CONSENT REVIEW SIGN COMPLETE Review Your Loan Agreement Carefully read your Application and Loan Agreement and all of its terms and conditions, using the link below.Note: This file is a PDF file. A new window will open in the Adobe Acrobat software. There are multiple pages within the window; please use the page up and down keys on your keyboard to page through the document.When you have finished reviewing the entire document, close the Adobe Acrobat window. You must indicate that you have read the Application and Loan Agreement in order to continue. Private Loan Agreement PDF 6 Pages Notice: You must download and view the application before continuing. By clicking "Continue" below, you are indicating that you were able to view and have read in full the Application and Loan Agreement and all of its terms and conditions. Your request is being submitted. 2011 by XXX Services, Inc.Contact Us | Privacy Policy | Terms of UseQuestions? Call XXX-277-0495; M-F, 9 a.m.-8 p.m. ET"

    And I am validating to see if text "PDF 6 Pages" is present.

    I used Browser("title:=.*","creationtime:=0").Page("title :=.*").Object.documentElement.innertext to extract text on the page and then used Instr(1,returnVal,expVal,1) > 0 to execute my validation. And I do understand that using instr() is not a reliable method. Can anyone else please tell if there is a way that guarantees that above is validated always. In my case in some instances above approach works but in many it doesn't.

  2. #2
    Junior Member
    Join Date
    Jul 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating long text string?

    something like this should work, as long as there are no other elements on the page that contain the text "PDF 6 pages".

    textExists=Browser("title:=.*","creationtime:=0"). Page("title:=.*").WebElement("innertext:=.*PDF 6 Pages.*").exist(0)

  3. #3
    Senior Member
    Join Date
    Feb 2003
    Posts
    533
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating long text string?

    Thanks for the post. In my case I am trying to make it happen thru our framework hence the limitation. As another example in the same string I also need to validate "When you have finished reviewing the entire document, close the Adobe Acrobat window. You must indicate that you have read the Application and Loan Agreement in order to continue."

  4. #4
    Member
    Join Date
    Aug 2011
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating long text string?

    Hi,

    Did you try out RegExp object for this? Check the below code -

    sMain = "PALS <<YOUR FULL TEXT>> 9 a.m.-8 p.m. ET"
    sPrtn = "PDF 6 Pages"

    Set oReg = New RegExp
    oReg.Pattern = sPrtn
    oReg.Global = True
    oReg.IgnoreCase = True

    Set obj = oReg.Execute(sMain)
    msgbox obj.Count
    Regards,
    A n i s h

    [My QTP Blog]

  5. #5
    Member
    Join Date
    Aug 2011
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating long text string?

    Also I didn't get 1 thing. Why is InStr() not reliable method?
    Regards,
    A n i s h

    [My QTP Blog]

  6. #6
    Senior Member
    Join Date
    Feb 2003
    Posts
    533
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating long text string?

    [ QUOTE ]
    Also I didn't get 1 thing. Why is InStr() not reliable method?

    [/ QUOTE ]

    I guess it is reliable if you have few text strings and not when you are validating say 2-3 statements text delimited by period or other form of separators. Will look into your other post and see if it works.

    Thanks!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:37 AM.

Copyright BetaSoft Inc.