Geeks Talk

Prepare for your Next Interview




How to check text/value during run-time?

This is a discussion on How to check text/value during run-time? within the QTP forums, part of the Software Testing category; 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) (...


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-09-2008
Contributing Member
 
Join Date: Jun 2008
Posts: 55
Thanks: 3
Thanked 0 Times in 0 Posts
learqtptesting is on a distinguished road
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.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-10-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 171
Thanks: 3
Thanked 12 Times in 12 Posts
NawabShaikh is on a distinguished road
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
Reply With Quote
  #3 (permalink)  
Old 07-10-2008
Junior Member
 
Join Date: Jul 2008
Location: India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ValarJesus is on a distinguished road
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
Reply With Quote
  #4 (permalink)  
Old 07-10-2008
Junior Member
 
Join Date: Jun 2008
Location: Navi Mumbai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rockstar is on a distinguished road
Re: How to check text/value during run-time?

Value = Browser(b).Page(P).WebEdit(w).getROProperty("innertext")
Reply With Quote
  #5 (permalink)  
Old 07-10-2008
Contributing Member
 
Join Date: Jun 2008
Posts: 55
Thanks: 3
Thanked 0 Times in 0 Posts
learqtptesting is on a distinguished road
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?
Reply With Quote
  #6 (permalink)  
Old 07-10-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 171
Thanks: 3
Thanked 12 Times in 12 Posts
NawabShaikh is on a distinguished road
Question Re: How to check text/value during run-time?

Reporter.ReportEvent micFail, "Reult","Value not matching"
Reply With Quote
  #7 (permalink)  
Old 07-10-2008
Contributing Member
 
Join Date: Jun 2008
Posts: 55
Thanks: 3
Thanked 0 Times in 0 Posts
learqtptesting is on a distinguished road
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
Reply With Quote
  #8 (permalink)  
Old 07-15-2008
Junior Member
 
Join Date: Feb 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Gaurang033 is on a distinguished road
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.
Reply With Quote
  #9 (permalink)  
Old 07-16-2008
Contributing Member
 
Join Date: Jun 2008
Posts: 55
Thanks: 3
Thanked 0 Times in 0 Posts
learqtptesting is on a distinguished road
Re: How to check text/value during run-time?

Guarang,

Appreciate your advice. never tried the raise question without attempting to do it. However, still get stuck.

You can ignore the posted question if you don't like\want or know and let others who like to share thier knowledge/tricks to response.
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
how to add text check point within Expert View test.ing59 QTP 5 06-11-2008 04:46 PM
Text & Text Area Checkpoint ramyamca1984 QTP 4 01-31-2008 09:22 PM
what is the difference between Wait time and Think time? mantra LoadRunner 8 09-18-2007 02:26 AM
Completed My Diploma as Full time and BE Degree as Part time Geek_Guest Career Advice 0 05-21-2007 04:02 PM
Usage of check-in and check-out in designer sanghala Data Warehousing 2 03-07-2007 01:29 AM


All times are GMT -4. The time now is 08:03 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved