Hi,
using dT 6.2.0.1238 the creation of testruns via REST doesn't seem to work:
I get a valid response back but the testrun can't be found via GET and the testautomation dashlets don't show anything when sending the appropriate header with the tests.
I tried creating testruns via SoapUI, via Postman and eventually via http://<dtServer>:8020/api-docs/index.html#!/management/createTestRun using XML and JSON.The result is always the same.
Sample POST:
POST http://<dtServer>:8020/rest/management/profiles/CI/testruns HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/json
accept: application/json
Content-Length: 125
Host: <dtServer>:8020
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Authorization: Basic YWRtaW46YWRtaW4=
{
"category": "webapi",
"platform": "linux_x64",
"versionBuild": "3.2.8",
"versionRevision": "802518"
}
Response
{"testRun": {
"category": "webapi",
"href": "http://<dtServer>:8020/rest/management/profiles/CI/testruns/381c9959-98c6-4897-8eaf-558cf6263c57",
"id": "381c9959-98c6-4897-8eaf-558cf6263c57",
"numDegraded": 0,
"numFailed": 0,
"numImproved": 0,
"numInvalidated": 0,
"numPassed": 0,
"numVolatile": 0,
"platform": "linux_x64",
"systemProfile": "CI",
"versionBuild": "3.2.8",
"versionRevision": "802518"
}}
Notice the missing creationTime key in the response as described here https://community.dynatrace.com/community/display/DOCDT62/REST+Interfaces+for+Test+Automation
A GET to http://<dtServer>:8020/rest/management/profiles/CI/testruns.json/ returns no testruns:
{"message":"No test metadata was set or no testrun occurred between 1970-01-01T01:00:00 (timestamp: 0) and 2015-07-02T17:26:04 (timestamp: 1435850764109) with additional parameters: null","testRuns":[]}
Any help would be appreciated.
Thanks
Thomas
Answer by Florent D. ·
it is defaulting to 30 minutes because you have already a dashboard with those settings and they are inherited. It would default to 30 days if you where to open the test results dashlet in its own dashboard.
I'm sorry but I can't replicate your issue here. I even created the same dashboard as you have and it is fine for me.It really looks as if the license isn't working properly and blocks the feature.
I think you might want to raise a support ticket for this.
Answer by Florent D. ·
some dashlets can freeze and not show the right data after a while. Could you try to close it down and re-open it in a new dashboard? Change the time window to 1 hour as it defaults to 30 days.
Answer by Florent D. ·
first let me answer your previous post. The x-Dynatrace header you see in the response is used for internal purposes and you can ignore it. If you are really curious it is what we use to link the various application tiers together so it has nothing to do with the execution of tests.
So it now looks like you are seeing purepaths and that they are tagged properly but you cannot see anything in the test automation dashlet. This feature should only be available with the test centre edition so which license are you using right now?
Hi Flo,
Not entirely relevant to this problem, however: the X-Dynatrace header is not only for internal purposes.
It allows us to tag web requests with test names, virtual users, geographical regions etc.
Integrations with LoadRunner and jMeter for example use this (on top of the above mentioned integration using a test-run id) in the "Tagged Web Requests" dashlet.
More information: https://community.dynatrace.com/community/display/DOCDT62/Integration+with+Web+Load+Testing+and+Monitoring+Tools.
KR,
Kristo
Answer by Thomas F. ·
I just used a System Profile I created from scratch to make sure no sensor setting can be the culprit. Still same behavior.
Could it have anything to do with my license? In a Development Edition I saw there was some option for CI in the system profile settings. I do not see this with my Test Center license.
Answer by Thomas F. ·
Still not working
I see there is a different behavior when I provide NA+TR in the header or TN (+TR/RC, doesn't matter).
This header "X-dynaTrace: NA=TestEnrollMember ;TR=a05b88b0-0270-4dd1-873c-59925141adea" gives me at least a tagged request in dynaTrace and I get dynatrace headers back in the response:
X-dynaTrace: PT=549;PA=1983121591;SP=CI;PS=-2113336576
dynaTrace: PT=549;PA=1983121591;SP=CI;PS=-2113336576
When providing this header: "X-dynaTrace: TN=TestEnrollMember;TR=83f037d6-c74c-4e03-b74b-55b4e1cf0b29"
I don't get any dynaTrace header in the response at all. Same behavior when I just send this header: "X-dynaTrace: TN=TestEnrollMember"
In all cases I get the correct PurePaths. In the Servlet Details TN=TestEnrollMember shows up under "HTTP Tag: " In Web Request Details and not under Request Headers, same with the NA+TR headers. So the header is being sent correctly in all cases.
Nothing shows up in Test Results / Test Overview dashlets.
Answer by Florent D. ·
Hi
yes, that's what I was going to suggest. You must run tests to see something. The way the system works is by tagging purepaths/requests but if there aren't any then you won't see anything on the dashlet.
I ran a quick test without soapui and it worked fine. I called the POST testruns directly with chrome, extracted manually the id. I then ran fiddler in breakpoint mode and I called my web service. Fiddler held the request. I then added a X-Dynatrace header with the testrunid and pressed play. I could see the test fine in the dashlet. See screenshot. The first test was executed via soapUI and the second manually via the browser.
I hope this helps.
Flo
Answer by Thomas F. ·
In REST Interfaces for Test Automation I just found this:
A test run is listed if at least one test (method) is executed in the specified timeframe
So my approach to find the issue doesn't work. Will check again to send tests with Soap UI with the X-dynaTrace header containing TR.
That's correct, currently /testruns endpoint responds to GET request with a list of test runs that had at least a single test execution. It may not be too intuitive (taking REST guidelines into the account), so we'll be working to change that (probably in the next release). The plan is to make /testruns respond with all registered test runs and allow easy filtering if client wants to receive only those that had test executions.
Best regards,
Wiktor Bachnik
JANUARY 15, 3:00 PM GMT / 10:00 AM ET