SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5

Thread: get value?

  1. #1
    Member
    Join Date
    Dec 2003
    Posts
    205
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    get value?

    Hello,

    How do I get a value from a web page?

    Once the transaction has finished, the summary/invoice is displayed for the user to print.

    How can I read the invoice number from the page, store it somewhere.
    At the end I have a function that writes the values in a text document for later use.

    Thanks

  2. #2
    Junior Member
    Join Date
    Sep 2003
    Location
    Glenmont, NY
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: get value?

    In the active screen you can right click on the object you would like to send as output and choose "output value". Then select the appropriate value.

    For more info do a Quick Test Professional help search for "Output Value".
    Michael Ernest
    Quality Assurance Tester
    Farm Family Insurance Company
    Michael_Ernest@farmfamily.com

  3. #3
    Senior Member
    Join Date
    Jun 2003
    Location
    Tampa, FL
    Posts
    372
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: get value?

    Garifo -- that will work as long as what you are trying to get is an object...such as a web element. However, if it is just text painted to the canvas, or worse, a pdf or graphic display, it may not be as successful. Option two would be a Text Output...to do this, actually block off the invoice number in the active screen, right click, and select Text Output...the following dialog box will let you select text in front of and behind the target text as delimiters, e.g. "Your invoice number is:" and then whatever comes next is your output. Finally, if that does not work, you can do a Text Area output, which is a bitmap screen scrape OCR'ed...this cannot be done from the active screen, you have to actually record it into your script. I recommend reviewing the help file for these, there is a lot of flexibility in setting them up.

    Good Luck,
    David

  4. #4
    Junior Member
    Join Date
    Sep 2004
    Location
    Canada
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: get value?

    I have the same problem. I tried to use Text and Text Area Output Value for captured a value. QTP send me the next Message.

    Logical Name:ThunderRT6PictureBox
    Class:Winobject
    Can not create Text Area Output
    Cannot Retrieve text for this object

    Can you help me to resolve this problem..
    Thank you

  5. #5
    Member
    Join Date
    Dec 2003
    Posts
    205
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: get value?

    I was able to pick up the values I needed by using the following. It might not be the best way but it saved me some time. Hope this helps someone else.

    Dim x, t
    x = Browser("homepage").Page("regPage).WebTable("INVOI CE").GetCellData(2,2)
    msgbox x
    'the function below will remove the unwanted 'characters and replace them with 'spaces since I know what text is 'before 'the number I decided to use that as the reg exp.

    Dim RegEx
    Set RegEx = New RegExp
    RegEx.Pattern = "Invoice Number: " '
    RegEx.Multiline = True
    RegEx.Global = True
    x = RegEx.Replace(x, " ")
    RemoveWhiteSpace = x
    msgbox x
    '************************************************* ******
    Dim t 'for total
    t = Browser("homepage").Page("reg Page").WebTable("Total").GetCellData(2,3)
    msgbox t

 

 

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.00%
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 03:41 AM.

Copyright BetaSoft Inc.