0

I'm working on practicing some good solid DevOps/Agile methodologies, and so one of the things that I'm working on is testing some custom reporting logic that I've written. Here's the scenario that I'm trying to test:

  1. Navigate to the home page (this triggers a page event that I'm looking to track)
  2. Navigate to another page that does not trigger this page event.
  3. Wait for an agent to run (it runs every 30 seconds) to process the page event count.
  4. Run an API call to verify that my page event count logic is working.

So, doing this manually, I am able to do each of these steps without issue. However, I really want to automated this because it is error prone, takes time (and concentration) to run, and when my manager comes back and asks if I tested this scenario, I can tell them "Yes, we've been testing that every time that we commit code changes".

Here's what I've tried:

  • Visual Studio: I've written a call to the website (using WebRequest), but I never get any Contact/Interaction information written to the Mongo DB.
  • LoadCompletePro: I've used this tool to simulate someone clicking around on the website, but again, I don't get any Contact or Interaction information written to the Mongo DB.
  • Selenium: I ran our Smoke Test on my local computer, which simulates about 20 minutes of solid traffic to the website, but again, I don't get any Contact or Interaction information written to the Mongo DB.

So at this point, I'm stuck at step #2, as I can't seem to get the data recorded to run my custom queries against. I believe that once I get past this hurdle, I can have the code wait for a certain amount of time to give Sitecore a chance to write the data to Mongo, and then for my agent to process the new data.

Has anyone been able to get any automated tools to trigger Sitecore's Analytics? If so, what did you do to make that happen?

I'm currently running on Sitecore 8.1 (original release).

3
  • Are you waiting long enough for the session to end or forcing the session to end. Thats when the page events will be written to xDB.
    – Chris Auer
    Commented Apr 26, 2017 at 1:14
  • Are you getting xDB data from your normal users? Just not from your tests? Do your tests allow cookies since thats where Sitecore keeps the session information?
    – Chris Auer
    Commented Apr 26, 2017 at 3:07
  • Yes, I am getting data from my normal users. I have my session timeout setting set to 1 minute. So it ended up being that I didn't have the robot detection turned off. Commented Apr 26, 2017 at 21:32

1 Answer 1

2

We run VS Load Tests against Sitecore and get results consistently.For some tests, we force session close, to make writing tests easier, so that we don't have to wait for 20 mins to session to close and the data to get written to Mongo.

One obvious thing that can cause Sitecore to skips analytics is robots detection. I.e. if sitecore thinks the page is from a robot/crawler, it doesn't get included.

See: https://doc.sitecore.net/sitecore_experience_platform/setting_up_and_maintaining/xdb/robot_detection/visitor_identification_using_robot_detection

So try disabling Robot detection or including mouse movement into the tests.

Secondly, make sure that your User Agent or IP is not in the excluded list:

https://doc.sitecore.net/sitecore_experience_platform/setting_up_and_maintaining/xdb/robot_detection/robot_detection

1
  • The problem was in the robot detection. That makes sense, I guess I just didn't consider my load test as a robot. :) Thanks! Commented Apr 26, 2017 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.