Google analytics automation testing - google-analytics

The ask is, we have a website which triggers multiple events based on user's action and we wanted to simulate those scenarios using automation script and also needs to understand if Google Analytics events has been raised behind the scene.
Just curious whether is there any tool available in market which can help us to automate. Thanks!

Install Chrome Extension Source Viewer. Go to the analytics debugger extension in the store and use the Extension Source Viewer to download a zip file of the extension. Open background.js and edit debug = false(line 4 currently) to
debug = true
In Chrome Browser go the Extensions Window, turn on Dev Mode (checkbox in that window). Use the Pack Extension button and select the folder you just edited to make a file called ga_tracker.crx.
Drop that crx file into your project. For example I copied it into my virtualenv.
test.py
env/
bin/
ga_tracker.crx
And this is python selenium test, test.py. Edit the path for add_extension if you put it somewhere else.
import re
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class FindTest():
def test(self):
self.chrome_options = webdriver.ChromeOptions()
self.chrome_options.add_extension('env/bin/ga_tracker.crx')
self.driver = webdriver.Chrome(chrome_options=self.chrome_options)
self.driver.get('https://www.localsbarguide.com')
for entry in self.driver.get_log('browser'):
print(entry)
for entry in context.driver.get_log('browser'):
if 'https://www.google-analytics.com/analytics_debug.js' in entry['message']:
my_regex = re.escape('title') + r".*." + re.escape('The Premiere Drink Special & Happy Hour resource | Locals Bar Guide San Francisco')
if re.search(my_regex, entry, re.IGNORECASE):
print('Found GA event with expected title.')
self.driver.quit()
runtest = FindTest()
runtest.test()

Related

wso2 api manager analytics pdf report logo not changing

In wso2 api manager analytics pdf report, I tried to change pdf logo in report, but not changed logo. could you please guide me?
wso2am-analytics-3.2.0\wso2\dashboard\deployment\web-ui-apps\analytics-dashboard\public\images
pdf-report-logo.jpg
This is expected.
The PDF Generator uses the wso2-logo.jpg placed inside the plugin. Following are the places referring to insert the logo the Report. Therefore, if you change the pdf-report-logo.jpg, it will not reflect in the generated reports.
public static void insertLogo(PDDocument document, PDPageContentStream contentStream) throws IOException {
InputStream in = ReportApiServiceImpl.class.getResourceAsStream("/wso2-logo.jpg");
PDJpeg img = new PDJpeg(document, in);
contentStream.drawImage(img, 375, 755);
}
Report Generator | source
Report Util | source
Resources | source
If you really want to change the image, then, you have to build the plugin with your respective logo image and place it inside the Analytics and try the scenario.
Update
Find the instructions to build the required components and place them in the Analytics node.
Clone the analytics-apim repo. The presented link points to the Analytics repo related to 3.2.0
Navigate to analytics-apim/components/org.wso2.analytics.apim.rest.api.report/src/main/resources/ location and replace the wso2-logo.png with your logo
Execute the following command to build the repo from the root directory of analytics-apim (After first build, you can execute the following command from the respective component to build that only and not required to run this again from the root directory)
mvn clean install package -Dmaven.test.skip=true -Dfindbugs.skip=true
Once the build is finished for the org.wso2.analytics.apim.rest.api.report 3.2.0, copy the built JAR artifact from analytics-apim/components/org.wso2.analytics.apim.rest.api.report/src/target directory
Go to the Analytics node and move to <analytics_home>/wso2/lib/plugins directory. Backup the existing org.wso2.analytics.apim.rest.api.report_3.2.0.jar and place the newly built JAR artifact. Once placed, rename the JAR to have the same pattern as the backed-up one. (You may wanna update the -3.2.0 with _3.2.0)
Start the Dashboard node and try downloading the report

Send data from Share Extension to Xamatin.Forms app

I work on Share Extension. And it only has a sample project (following link) and a general extension documentation.
Basic project:
Extension documentation:
When I click share with my app on iphone (for example on photos), I want to send this file to my app and upload it remote server. But I couldn't find anyway to send object from share extension. I looked up and probably I need to use "NSUserDefaults" and I tried to use it that:
I did necessary settings (creating group id, app id etc) on my apple developer account.
I did necessary settings on my project Entitlements.plist
I try to send on ShareViewController - DidSelectPost method in the my project's share extension as below:
var default = new NSUserDefaults ("group.com.myapp.AppName", NSUserDefaultsType.SuiteName);
default.SetString ("Test content", "TestKey");
default.Synchronize ();
4)I try to receive string data on my main project's AppDelegate as below:
var default = new NSUserDefaults ("group.com.myapp.AppName", NSUserDefaultsType.SuiteName);
var key = default.StringForKey ("TestKey");
string value = key;
But I couldn't do it. And I saw someone did this with OpenUrl function. I tried this and this didn't work.
I started mobile programming with Xamarin forms and I don't know enough native iOS programming (I only learn with Xamarin). I think share extension has insufficient documentation.

Experimenting with Tincan/XAPI project created using Adobe Presenter

Using Adobe Presenter, I have created a presentation with an opening slide, two quiz questions, and a concluding slide. I have published as a Tincan presentation (have confirmed that there is a tincan.xml file published), uploaded to the web and run the presentation. The presentation runs fine, quiz works fine. Two problems:
1)
The index.htm file references
./data/resources/ha/wr_/OpenAjaxManagedHub-all.js
But there is no such directory as wr_
so naturally no files in it.
Chrome dev tools console reports the file not found.
2)
tc-config.js contains the following reference to a publicly available Record Store, so I would expect an attempt to store the activity there when the presentation concludes:
TC_RECORD_STORES = [
{
endpoint: "https://cloud.scorm.com/ScormEngineInterface/TCAPI/public/",
auth: "Basic VGVzdFVzZXI6cGFzc3dvcmQ="
}
];
But looking in Chrome dev tools Network tab, there is no XMLHttpRequest. In fact, the only thing in the Network tab is a bunch of GETs for the files in the presentation.
Also, my understanding is that if it had been stored, it would show up here:
http://tincanapi.com/report-sample/
And it does not show up there.
Don't know if these two problems are related.
Any clues will be appreciated.

Kivy Async Image - Static Google API doesn't load

i try to asyncronously load a static google maps image via the google api.
The code below is taken from the kivy reference base, it works with other images, but not if i use the google link. The link works fine in the web browser. (Also note that the source string is in one line in my original py file, that just doesn't display right here)
my kv
from kivy.app import App
from kivy.uix.image import AsyncImage
from kivy.lang import Builder
class TestAsyncApp(App):
def build(self):
return AsyncImage(
source='http://maps.googleapis.com/maps/api/'+\
'staticmap?center=47.909,7.85&zoom=13&size=600x300')
if __name__ == '__main__':
TestAsyncApp().run()
Help is very appreciated!
With Kivy 1.8.0, URLs like the one above don't work as expected. Kivy tries to parse the URL and find the file extension, which fails of course. In the development version, we now check the MIME type reported by the server, but you can work around this in 1.8.0 by using a fake query parameter:
return AsyncImage(
source='http://maps.googleapis.com/maps/api/'+\
'staticmap?center=47.909,7.85&zoom=13&size=600x300&ext=.png')

How to open a particular file with my QT application on Mac when i double click the file?

I'm finding no way how to open a specific file format which can be opened by my Qt app automatically(when i double click the file).Please let me know how to do this.
Thanks!
You need to set up your Information Property List file (Info.plist) in your application bundle to identify files that can be opened by your app. See http://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Introduction/Introduction.html
Specifically, set the CFBundleDocumentTypes key: add items, the file extension and the role of your application (does it edit, view, etc the file).
After you have done this, finder will need to reload the plist. Then you will be able to choose to open files of that type with your application.
In your application, you will need to subclass QApplication and set up a response for QEvent::FileOpen. More information on doing that was given in Qt Quarterly Issue 18.

Resources