SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Nov 2007
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    how to use reporter.reportevent

    Hi

    I want to capture a web text and then use reporter.reportevent to get the results in test results.I am doing the following to capture text,thereafter don't know to report.

    text=Browser("Browsername").Page("page").Webelemen t("Webtable").Getroproperty("innertext").

    can anyone please send me any link that i can read or any hint as to how to report the captured text results to the results folder through reporter.reportevent or anythingelse maybe.I tried to search through the forums ,but couldn't find the required answers.

    Thanks for the help.

  2. #2
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to use reporter.reportevent

    [ QUOTE ]

    text=Browser("Browsername").Page("page").Webelemen t("Webtable").Getroproperty("innertext").


    [/ QUOTE ]
    Reporter.ReportEvent micDone, "Step blah", text

    This should be easy to find in QTP's online help.

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: how to use reporter.reportevent

    Now that is strange to me. Did you refer to QTP help and look for ReportEvent?

  4. #4
    Junior Member
    Join Date
    Nov 2007
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to use reporter.reportevent

    I did look in help.let me be more specific with what i did

    text=Browser("Browsername").Page("page").Webelemen t("Webtable").Getroproperty("innertext").

    If text=3(say)then
    reporter.reportevent 0,"price","display is right"
    else
    reporter.reportevent 1,"price","display is not right"

    when i run the script i get the result as step failed,eventhough the text captured is right i.e here it is number 3.So that's the reason I thought I was not using reporter.reportevent in a right way.

  5. #5
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to use reporter.reportevent

    You are missing double quotes.

    If text="3" then
    reporter.reportevent 0,"price","display is right"
    else
    reporter.reportevent 1,"price","display is not right"
    End If

    OR

    If cInt(text)=3 then
    reporter.reportevent 0,"price","display is right"
    else
    reporter.reportevent 1,"price","display is not right"
    End If

  6. #6
    Junior Member
    Join Date
    Nov 2007
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to use reporter.reportevent

    Hi

    Thanks TReddy

    Is there any other rather than hardcoding the value(i.e number 3 here ) .This value is going to change again ,so I am not sure how good this script will be for second run.

  7. #7
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to use reporter.reportevent

    anjali79,

    In the future please consider your initial question more carefully. Your issue had nothing to do with the QTP Reporter.ReportEvent (as you initially posted), but rather the primitive IF comparison question (as you later exposed).

    As to your specific question: "...rather than hardcoding the value" you can set an expected value by:

    1. using a const value
    2. using a variable that gets set by runtime assignment
    3. extracting a value from a DB at runtime
    4. using a previous set [static or runtime] environment variable
    5. and the list goes on...

    So, this does not really differ no matter what tool you are using, just basic programming; in this case vbScript in the context of the QTP runtime environment.

 

 

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 11.54%
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 07:56 AM.

Copyright BetaSoft Inc.