0

I am working on Analytics automation test, using Java and Selenium WebDriver. Our site has Analytics tracking events set on important elements on the site. I need to verify that on clicking a certain element under test, the Analytic event is in fact fired.

I'm testing it on Chrome. When I click F12, I can see in the console that a Omniature Analytics event is fired on each element click event.

How can I achieve this task? If anyone can help me with some references or sample code I'll be very Thankful.

A-G
  • 1
  • 2
  • 4

3 Answers3

1

If you are trying to automate Adobe Analytics in selenium, please use Adobe Experience Cloud debugger plugin extension for chrome. This chrome extension can be loaded in the new tab of chrome browser during execution and validate the analytics data

0

Your issue has nothing to do with Selenium Webdriver.

What you need to do is to detect if an XRH request is sent or not. For this you probably should work with JavaScript.

There is a topic on stackoverflow about this: JavaScript: Detect AJAX requests

Community
  • 1
  • 1
Denis Koreyba
  • 3,144
  • 1
  • 31
  • 49
0

To test an analytics request, you'll have to capture network traffic request. Which can be achieved through BrowserMob Proxy.

Here's sample code using selenium, which might be helpful.

Shoaib Mal
  • 89
  • 1
  • 7