Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QTP, using calculated values in tests, disabling logging

Status
Not open for further replies.

MFD1234

Technical User
Feb 28, 2007
1
AU
I have 2 questions that I cannot seem to answer either easily or elegantly in QTP...

1. How can I check a value against a calculated value, eg if i have (psuedocode)
Dim A
if < 20 then A = A * 1.10

Then how can I use A in a checkpoint ( do I have to use the QTP Datatable?)

2. Suppose I just want to check for a condition before starting a test (remote server re-start/recovery); how can I get QTP to temporarily disable writing failure results to the log, and how can I get at the value to see that it is passed or failed.

I come from a Rational software background and find QTP far less flesible!!! Any help greatly appreciated.
 
1. How can I check a value against a calculated value, eg if i have (psuedocode)
Dim A
if < 20 then A = A * 1.10

Then how can I use A in a checkpoint

--which value do u want to compare A with?? is it the new value u want to check or is it the old value or both of 'em. Or is that you want to take the new A and compare it with something else in your app?

2.Suppose I just want to check for a condition before starting a test (remote server re-start/recovery); how can I get QTP to temporarily disable writing failure results to the log, and how can I get at the value to see that it is passed or failed.

--If Condition Pass Then
Reporter.reportevent micpass,"Continue to next step"
Else
Reporter.reportevent micfail,"Remote server down"
ExitAction(or you can do a ExitRun)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top