Results 1 to 9 of 9

Thread: How to check text/value during run-time?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Expert Member
    Join Date
    Jun 2008
    Answers
    204

    How to check text/value during run-time?

    Example,

    In a page contains four objects and entered as below:

    1) Input field called QTY-ITEM: 2
    2) Input field called UNIT PRICE: 10.50
    3) Submit button
    3) (Not sure what it is) filed: $21.00 (this varies bases QTY-ITEM * UNIT PRICE)

    I want to capture whatever in the(Not sure what it is) filed: so I can verify that it is accurate to pre-determined values.


  2. #2
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    Question Re: How to check text/value during run-time?

    1. Value = Browser(b).Page(P).WebEdit(w).getROProperty("innertext")

    ELSE

    2. Value = Browser(b).Page(P).WebElement(w).getROProperty("innertext")


    If none of the above then please spy on the control & do let us know.

    Regards,
    Nawab


  3. #3
    Junior Member
    Join Date
    Jul 2008
    Answers
    2

    Re: How to check text/value during run-time?

    Hi,

    I think that 4th object may be Total Price. (Because It should vary depend on Price*item)

    Please try this to get Run time object Property- getROproperty

    Total=Browser(" Browser name").Page(" Page name").WebEdit("QTY-ITEM").getRoProper("text")
    Msgbox Total



    Please verify the Browser and page and object name and value in your application


  4. #4
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Re: How to check text/value during run-time?

    Value = Browser(b).Page(P).WebEdit(w).getROProperty("innertext")


  5. #5
    Expert Member
    Join Date
    Jun 2008
    Answers
    204

    Re: How to check text/value during run-time?

    All,

    Thank for your response.

    I have a new relate question. How do make the test fail if the value is not as my pre-determined?


  6. #6
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    Question Re: How to check text/value during run-time?

    Reporter.ReportEvent micFail, "Reult","Value not matching"


  7. #7
    Expert Member
    Join Date
    Jun 2008
    Answers
    204

    Re: How to check text/value during run-time?

    All,
    I tried the given code and they didn't work. I also verify that the object is WebElement. Therefore, I could not try webedit. below is my code, please point out the error.


    rate = browser("mytesting").Page("sale test").WebElement("total sale").GetROProperty("3,300.00") -> what is the return value here?

    msgbox rate -> this displays blank message


  8. #8
    Junior Member
    Join Date
    Feb 2008
    Answers
    24

    Angry Re: How to check text/value during run-time?

    Quote Originally Posted by learqtptesting View Post
    All,
    I tried the given code and they didn't work. I also verify that the object is WebElement. Therefore, I could not try webedit. below is my code, please point out the error.


    rate = browser("mytesting").Page("sale test").WebElement("total sale").GetROProperty("3,300.00") -> what is the return value here?

    msgbox rate -> this displays blank message
    GetRoProperty is a method which will gives you the value of the property you pass as a argument.... 3.300.00 is not a valid property..

    Rather then keep asking question. I will suggest you to go through QTP help file.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact