| || |
I have a script which performs basic login, search and password. If I were to change the password in my parameter file and re run the script I see HTTP 500 in my log file.IS there a way I can capture the text in the log file and exit the test on error.
Re: Error Handling
So you're able to correlate the 500 error to a particular login/pw combo? If so, what appears on the browser? I know it's possible that a web/app server can be configured to display a "Pretty" error page that is received with an HTTP 200 status; so you might have to look for specific text on the page in order to indicate that an error was encountered.
To which log file are you referring? Trying to capture text in a log file via OpenSTA is going to be tricky, if not impossible. It just doesn't seem worth the trouble.
If your app is generating a 500 error on the backend and not presenting some sort of message on the front-end, that in and of itself could be a bug.
Re: Error Handling
Do a load response_info body into a LARGE variable (64KB for your version of OpenSTA) and use the LOG command. Do this for the get/post statement that is generating the 500 error. Heck, do it for all the primary get/post commands. Wrap the log in an if statement that tests a variable to see if you are in "debug mode". I do this for all my scripts and can turn on full logging with the setting of a single variable.
You will see the first 40 or so bytes when you view the log file in the results tab. BUT.. the entire text IS kept in a .txt file in the opensta repository for the test. The file you want to look at is (opensta/repository/tests/<test_name>/testlog.txt. You are limited to logging the first 64KB of the response with the standard version of OpenSTA. I have a version that increases this to 256KB which I make available to my support and training clients.
One thing you can do is just open the entire testlog.txt with a browser and it will try to render any html it sees which can make spotting errors easier on the eyes.