Friday, September 05, 2008

openSTA : Logging SOAP faults

The audit log contains the items you log. To log the fact that your web service returned a SOAP fault use something like:



CHARACTER*65535 BODY_RESPONSE
INTEGER FNIDOFFSET

...

LOAD RESPONSE_INFO BODY ON 1 INTO BODY_RESPONSE

SET FNIDOFFSET = ~LOCATE('SOAP:Fault', BODY_RESPONSE), CASE_BLIND
IF (FNIDOFFSET >= 0) THEN
LOG "SOAP:Fault error detected"
ENDIF



Enjoy!

Excel: "Pass" / "Fail" in a column and "Fail" in red

There is a pivot table spreadsheet on the openSTA site which allows you to work with timers. I wanted to compare that with a required result and then place "Pass" or "Fail" in the column depending on the result and then have "Fail" in red to highlight it.

You could of course use VBA but that requires a bit of programming skill.

The fist part is easy - just use the formula:

=IF(H1>K1,"Fail","Pass")

where H1 is the openSTA timer result and K1 is the required result.

The second part is done via selecting the "Pass" / "Fail" column and then right-click / Format / Conditional Formatting.

The condition is "Cell value is equal to "Fail"", then click on the "Format" button and select the red colour.

Enjoy!

openSTA : Creating random variables

I've been involved with openSTA testing lately and will blog on some things I learned.

One thing I needed to do was to run some tests on a web service that creates files. Each file had to be a different name.


INTEGER FILECOUNT, SCRIPT
INTEGER TIMEVAL
CHARACTER*10 C_FC
CHARACTER*10 C_TIMEVAL

...

ACQUIRE TEST-WIDE MUTEX "FC"
SET FILECOUNT = FILECOUNT + 1
CONVERT FILECOUNT TO C_FC
RELEASE TEST-WIDE MUTEX "FC"

ACQUIRE TEST-WIDE MUTEX "DocID"
LOAD TIME into TIMEVAL
!Ensure that the time provides 7 digits
SET TIMEVAL = TIMEVAL + 1000000
CONVERT TIMEVAL TO C_TIMEVAL
RELEASE TEST-WIDE MUTEX "DocID"


and then in the web service, set the title to:

'Doc name '+ C_FC + C_TIMEVAL + '.doc

Enjoy!