Hubert Grininger says:
Nov 10, 2009 16:06

dynaTrace AJAX Edition automatically captures a new session for every browser that is launched from the AJAX Edition. There exists a way to automate this capturing when the browser is launched from outside the AJAX Edition. A typcial use case scenario would be if you run automated test scripts that drive the browser, e.g.: when using Selenium or Watir. In these cases the browser is launched by your automation tool and not the AJAX Edition. In order for the AJAX Edition to capture traffic the dynaTrace AJAX Agent in your browser needs to be activated.

Activation of the dynaTrace AJAX Agent (valid for Ajax Edition 3.x)

The dynaTrace AJAX Agent can be configured via environment variables. These variables are checked when the Agent is loaded by IE or FF and they allow you to control activation, session name and connectivity.

Env-Variable

Description

DT_AE_AGENTACTIVE

true=Activates Agent

DT_AE_AGENTNAME

Name of the recorded session, e.g.: TestRun1234. Default: Visitied URL plus a timestamp.

DT_AE_SERVER

(optional) Allows you to connect to a dynaTrace AJAX Client on a different port (only localhost connections are allowed). Default: localhost:9988

DT_AE_CLEARCACHE

(optional) Allows you to clear the browser cache before browsing through your sites. Default: false

DT_AE_STARTURL

(optional) Allows you to specify an initial Start Url. Default: about:blank

Activation of the dynaTrace AJAX Agent (valid for Ajax Edition 2.x)

The dynaTrace AJAX Agent can be configured via environment variables. These variables are checked when the Agent is loaded by IE and they allow you to control activation, session name and connectivity.

Env-Variable

Description

DT_IE_AGENT_ACTIVE

true=Activates Agent

DT_IE_SESSION_NAME

Name of the recorded session, e.g.: TestRun1234. Default: Visitied URL plus a timestamp.

DT_IE_SERVER_HOST

(optional) Allows you to connect to a dynaTrace AJAX Client on a different machine. Default: localhost

DT_IE_SERVER_PORT

(optional) Allows you to connect to a dynaTrace AJAX Client on a different port. Default: 9988

DT_IE_CLEAR_CACHE

(optional) Allows you to clear the browser cache before browsing through your sites. Default: false

Generic Use Case Scenario with an Automation Tool

With the automation options in mind you can now do the following steps with your test automation
a) Start a dynaTrace AJAX Edition Client on one machine in your test lab or on each test machine that runs automation tests
b) Prior to launching the Automation Scripts you can set the Environment Variables on each local machine to activate the dynaTrace AJAX Agent and let it either connect a local or remote running dynaTrace AJAX Client
c) Run your test scripts
d) Analyze the automatically captured sessions in the dynaTrace AJAX Client

  1. It's great that the Agent can be automated, but is there an API or command-line interface for mining data from captured sessions? True end-to-end automation requires more than just automated test execution; it also includes data collection, parsing, and reporting as well. The ability to pull dynaTrace-collected data so that it can be correlated with data collected by other tools would be an extremely valuable feature.

    1. Hi Bryan. Thanks for the input. We heard this requirement for the AJAX Edition. On dynaTrace APM we have features to query data via REST/WebServices. This allows us to automate data analysis in Continuous Integration Environments. There is also a recent blog article about how we internally use dynaTrace in Continuoue Integration: http://blog.dynatrace.com/2010/01/27/eating-our-own-dog-food-how-dynatrace-does-continuous-apm-internally-in-development-with-dynatrace-ta-lead-stefan-frandl/
      Our plans are to extend this to our AJAX Edition as well.

      1. Hi
        I have this need too. We would like to perform a lot of tests, and gather only specific data from them. Is it possible to know when this will be available ?

        1. Hi Olivier. We are looking at the summer timeframe. It would be great to get more feedback from you regarding your exact use case, e.g.: what kind of data would you want to query. I will send you an email so that we can discuss your requirements - this will help us improve the product to fit our users requirements. thanks in advance

      2. Hi Andreas,

        We have a similar need to capture the dyna trace data programatically. Do we have any exposed APIs?

        Thanks
        Sapna Grover

        1. There are two options for you

          a) check out what is new with dynaTrace AJAX Edition 2.0 and the performance beacons we automatically sent -> read "Extended Automation Support" on the following blog post: http://blog.dynatrace.com/2010/11/17/dynatrace-ajax-edition-2-0-is-ready-for-download/

          b) check out our commercial offering which gives you full access to the captured browser diagnostics data + comparison of sessions + some more additional features that will help you in your continuous integration environment: http://ajax.dynatrace.com/ajax/en/content/upgrade-automate.aspx

          Cheers

          Andi

  2. This is great however the client must be up and running for it to collect the data. Is there a way to start the client but hide it from the user? Ideally I would like to be able to start the client in the background and then come back a couple days later and collect all the sessions without effecting the user in any way.

    1. Hi Charles
      If you look at the environment variables then you will see two that allow you to define a host and a port for the dynaTrace AJAX Edition. This allows you to run the AJAX Edition on any machine in your environment and just run the browser plugin on those machine that collect the data. You only have to specify the host and port settings on that machine that launches the browser.
      We do recommend to check the network overhead that this produces. Depending on how much data you collect (depends on how heavy your app is on JavaScript and how many details you have turned on throught the preference settings) dynaTrace AJAX Edition may require a lot of network bandwidth to transmit the data between your machine that runs the browser and the machine that runs the AJAX Edition.
      Let me know if this works for you

      1. This would work however for this particular situation I am trying to gather the network and rendering information from machines that are not on the best networks. I would be worried that the traffic between the client and host would cause the already questionable performance even worse. 

        1. if you are only interested in rendering and network activity you can turn off full JavaScript tracing. Go to the preference dialog. On the IE Add-on tab uncheck "Capture full JavaScript call trace" and "Capture calls into DOM API". That will greatly reduce the data that is captured and therefore minimizes the network bandwidth requirement

  3. I set DT_IE_AGENT_ACTIVE=true in env.

    When I start a dynaTrace AJAX Edition Client,then open IE,I find the summary report's network is 0 ms.

    I remove DT_IE_AGENT_ACTIVE=true in env.

    When i start a dynaTrace AJAX Edition Client by IE's add-one,I find the summary report's network is not 0 ms.

    Who can help me?

    1. hi alex

      can you additional try setting the following two values:

      set DT_IE_SERVER_HOST=localhost
      set DT_IE_SERVER_PORT=9988

      and try again?

      1. Hi Andreas:

            I try this ,but the result is same.

            But I try in another PC with IE7,it an run successful.

           And another,I need to analysis summary report by JAVA,and create another XML report for other application.Can i analysis the sessions?Where is the plain report ?

        1. Hi alex - can you send me the logfiles under C:\Documents and Settings\YOUR USER\Local Settings\Application Data\dynaTrace\browser?
          my email is andreas.grabner@dynatrace.com