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.
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
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
Re: How to check text/value during run-time?
Value = Browser(b).Page(P).WebEdit(w).getROProperty("innertext")
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?
Re: How to check text/value during run-time?
Reporter.ReportEvent micFail, "Reult","Value not matching"
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
Re: How to check text/value during run-time?
[QUOTE=learqtptesting;32486]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[/QUOTE]
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.
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.