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 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. 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. 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 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")) ();
Comments
Post a Comment