I’m not sure how to see log statements in an Http Response or completion method. I imagine the problem could be that these Log statements are part of another thread(?), but I’m not sure what to do resolve it.
Here’s my test project, indicating a “successful” result for my test. I actually gave it a bogus url, and want to see the expected failure response.
It looks ike you are using asynchronous code in a synchronous context — your test just fires off to getUser, which initiated an async HTTP request (to be called back later), and then moves on.
Since you just have the one test, chances are the test completes and the executable is done, long before there HTTP request had a chance to complete. You cannot test async code in that way.
There’s two ways to solve this. well three. One is to use sync code (Http.ExecuteRequestSynchronous). The other is to wait and let the request complete before terminating the test. This could be achieved by using an Event that gets triggered by the successfully completed request and gets waited for in the test or (less ideal and a hack, but easier for a simple test) by just putting the main/test thread to sleep for a time sufficient enough for the request to finish.
Tried following the same steps as before with the latest elements.jar file, but got a different result. It added another reference instead of replacing the earlier one. Not sure, but I think the small “e” vs. capitalized “E’” in Elements may also be involved. I’ve tried undoing and retrying, but I’ve ended up with a mess.