0

I have the dynatrace js agent piece of code and i am trying to inject that minified piece of code into the browser instances that pop up on when the protractor tests are running on the selenium grid.

The reason that this is not automatically injected is the fact that they are running on a docker container. What would be the best way to do a manual injection of the code in this case?

I tried doing this:

var dtagent = require('./dtagent-test.js');
browser.driver.executeScript("dtagent");

dtagent  contains the minifed dynatrace code that needs to be injected.

but that did not work and it complained that window is not defined.

Any idea how this can work?

Thanks!

pj013
  • 1,393
  • 1
  • 10
  • 28

2 Answers2

1

I assume this is the Dynatrace JavaScript Agent for UEM (=User Experience Management)? Correct? If that is the case - you need to make sure that you have a Dynatrace Web Server or Java Agent installed on your web/appp server. Why? Because this JavaScript file will be delivered from the dynatrace agent on the server. ALSO - the javascript file will capture data in the browser and POST it back to your web/app server. This also requires the Dynatrace Agent installed on your web/app server.

So - whether you do manual or automatic injection - you have to have the dynatrace agent installed on your server side

Andi

Andreas Grabner
  • 645
  • 3
  • 7
-1

To understand more about the issue, need some information :

  1. You using On-Premise (in home hosted Dynatrace Server) or Saas Portal hosted Dynatrace .
  2. './dtagent-test.js' is actually referring where:

    a. If using SAAS portal, then the proper url mentioned or not?

    b. If using On-Premise, then as Andi described that the respective Agent has been configured and the Dynatrace Collector is getting connected properly.

Let us know more so that we can drill down and help you. :)

Elzo Valugi
  • 27,240
  • 15
  • 95
  • 114