java - How to automate test google analytics on every event fired using Selenium WebDriver -


I am working on the Google Analytics automation test with Selenium WebDriver Java binding. Our site has Google Analytics tracking events set to important elements on the site. I must verify that after clicking on a certain element of the test, the Google analytic event has actually been removed.

I'm testing it on Firefox when I click on F12, I can see in the console that a Google Analytics message on every element click event GET http: // www Is removed from .google-analytics.com / __ utm.gif .

  Sample code: - WebDriver wd = new Firefox driver (); Wd.get ("http://www.dummyExample.com/"); Wd.findElement (By.linkText ("Document References")). Click (); . Click on wd.findElement (By.id ("Ex2vc2")) ();   

How can I get this work done? I went to it but could not find a good answer. If someone can help me with some reference or sample code, I would be very grateful.

  1. How to test good GAS using Javascript. Example shows tests with phantomjs, because it is fast with JS stuff, but I think you can also use FF or other browsers. Also the author added the Gitb link with the code to try. The main approach to testing is calm, but it may take time to prepare the code and it can be supported later.

    They will be able to, but they are in HAR format. So the algorithm is simple, enable the proxy, work on the open website, smell the requests, parse them, and emphasize the values.

  2. To change the end point and to keep all requests secure, analytics usually sends a request to the same url, such as "or whatever, The webserver can be changed on trial eg this URL / etc / hosts to the localhost address. And then all requests sent to the web server will be received from the web server. This will require additional programming but this is the safest way to test IMHO

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -