blacklist test requests from google analytics using watir - ruby

I have to automate tests for a web application which runs google analytics script. I have chosen watir for the automation since I can script all the test cases with the same. The only problem is i dont know how to remove my test requests to the web apps from the google analytics report. Can anyone help me with the same? Is it possible to do that with watir? If not watir, is there any other web automation tool which I could use?
~Thanks and Regarads

using your hosts file to send the google analytics requests to another server is probably a better way

disable JavaScript in the browser that Watir drives, that will not execute Google analytics code
you can filter out requests that Watir made, I am sure there is a way in Google analytics to filter out specific IP or something similar

Related

How can I test the case where invisible Recaptcha detects a suspicious user?

I plan to use Google's invisible recaptcha to make sure bots don't sign up on my website. I think I followed all the instructions, but I want to test it to make sure it works and see how it looks. But I'm a human, so it just lets me click with no problems. Is there a way to make the invisible recaptcha think I'm a bot so I can test that experience on my site?
Try accessing your website through Tor. If you try using Google Search through Tor it will continuously offer you a reCAPTCHA, because bots are often using the IP addresses associated with Tor and Google knows this. I imagine it will work for your website as well.

Web API load testing

When I record script, my login page recorded as html. but other pages not recorded as html pages rather it shows as js and web APIs. I cannot able to record or create script using html url. Kindly anyone help what exactly the solution. I can able to load test only web API or any way to create script using html urls.
It depends on your application nature. The whole idea of web applications load testing is simulating real users which are using real browsers as close as possible so ideally your load test should exactly mimic the HTTP Requests originating from browser when user is doing actions according to application use case(s).
You should not be recording .js files as well as .css files, all images and other media (audio, video, flash, whatever), instead of this you need to configure JMeter to download embedded resources instead of recording and replaying the relevant requests.
If you need to load test the API itself you can omit simulating browser and send requests directly to API endpoints, check out Building a WebService Test Plan JMeter User Manual chapter for more details.

Gem to post message on google plus?

Is there any gem to post message on google plus from our rails application ?. I want to post a meesage on my google plus page whenever i logged in my application using google plus credentials. Please suggest me the gem name to do this. Thanks in advance.
EDIT
I have a app in goole plus. On behalf of my application users, my app should post messages.
I suggest to use gem 'google_plus'`
As Google plus having so many restrictions. Still I would Like to Share a link you can follow that..
How to share content from our site to google plus
For more reference:
https://developers.google.com/accounts/docs/OAuth2
https://developers.google.com/+/web/share/interactive#button_attr_calltoactionurl
I hope it will work fine...
Yes, there's a Ruby client library provided by Google which allows you consume their Google+ API
https://developers.google.com/api-client-library/ruby/apis/plus/v1
UPDATE
The URL above points to Ruby client library. The API you're looking for is moments.insert
https://developers.google.com/+/api/latest/moments/insert
There is an official Google API Client gem. However the Google+ API does not allow standard automated posting to a profile. The recommended approach to share posts is the share button or the interactive share API.
The automated posting that Google+ does support are:
App activities/moments are a way to make actions within your app visible to other users of your app. They do not appear in the Google+ posts stream.
Domains API can be used with Google Apps accounts to create posts that are limited to users within the company.
Pages API can be used to post to a page (not a profile) but is limited to approved partners.

Using Google Analytics on a jQuery Mobile app that runs entirely off the phone

I have made an app using jQuery mobile and phoneGap, and read its good to put Google Analytics on there. I just a little confused because most of the app (pages etc... ) runs from the index.html file on the phone. The only time the app communicates with the server is when it logs a user in and they do ajax requests to retrieve or put data to a database.
Can I still use the analytics package here? Or is the whole point of it to be used with an app where all the DOM etc is stored online?
Thanks
You can probably use the event tracking feature of Google Analytics to help you out here:
https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
You basically just fire a js function and pass in descriptive strings and category I think for each of the interactions you want to track / report on:
_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)
Hope that helps

Does Google Gadget works for an Internal Corporate Site?

We would like to use the Google Gadget concept in our corporate Intranet. Our infrastructure implies no external web dependencies.
The way I understand Google Gadget is that the gadget xml file requires some pre-processing before being displayed in a Html page:
<script src="http://www.gmodules.com/ig/ifr?url=http://mysite.com/my-gadget.xml
Is this mean I cannot render a gadget in a Page without this pre-processing?
Thank you
Not sure if this helps, but it is also possible to have google widgets make use of secure data behind a firewall by using the the Google Secure Data Connector
The browser still needs to have access to google servers to execute the widget, just data requests will be made to google and then be proxied back to a service running in your network which will then fetch the data.

Resources