DalekJS Click without an ID - dalekjs

Which is the right way to instrument DalekJS to click a link without an ID but based on the href?
Example:
Submit a form and then click on a link without an ID.
.click('href[URL]')

Have a look at the tutorial video (http://vimeo.com/71466029), at 8:00 he shows exactly what you need to do ;-)
.click('a[href="/foo.html"]')

Related

Chrome console to click

i would like to use the Chrome-console to click on a button.
So far I always used the Id, like:
$('[id="vcc-eu5"]').click();
or Title
$('[title="Delete this view and its saved rules"]').click();
of the button, but here, I can not find anything like that.
If I inspect the button I can see this:
<a class="wds-button wds-button--primary wds-button--sm apply-btn ">APPLY</a>
Is there a way trigger this button somehow? Where can I read about it?
The currently selected element in the Chrome DevTools is always available as $0.
So, you can just select it and the do $($0).click()
Or you can use a unique combination of its classes:
$('a.wds-button.wds-button--primary.apply-btn').click()

Element ID not being collected by Google Tag Manager?

I use tag manager's "click listener" to collect clicks on a website form, which I then analyse in the "events" section of google analytics. This all seems to be working fine, apart from with an important button that's part of the page template...
If you check out https://lptent.worldsecuresystems.com/pop-up-gazebos.html and click "Configure this Gazebo" you'll see a blue button appear in the header of the form which reads "chat to an expert". This is the button/element we are struggling with.
Any help or advice on tracking clicks on this element would be greatly appreciated!
Cheers,
Andrew
The href="javascript:void(0);" is preventing the event from bubbling up through the DOM.
Try instead adding a dataLayer.push({}); in your click function:
jQuery("a.lp_box").click(function(){
var rel = jQuery(this).attr("rel"),
grel = rel.split("#")[1];
jQuery("#"+grel).css("top", "60px" ).fadeIn(500);
dataLayer.push({'event': 'chatClick'});
bg_lightbox();
});
And then create your event in GTM using {{event}} equals chatClick as your rule for that event.

Google Tag Manager event tracking for dom elements

with Google Tag Manager Auto-Event Tracking (dataLayer.push), I want to track this information:
the name of the links clicked in my menu, for example:
<ul class="my-nav">
<li>
Anoter site
</li>
</ul>
so: 'Another site'
I want to push the name of the parent link name of the clicked link with this structure:
<li>Linkname
<ul>
<li>
Website name
<li>
<ul>
<li>
So there: I want 'Linkname'
the 'status' of a toggle link - whether the element has a class 'open' or not
<a class="content-toggler open" href="#">Hide all the content</a>
I have read through many tutorials and walkthroughs, but most talk about tracking links that go to external sites in general, or submit events and so on.
Here I want to track the name of a link in a certain dom tree.
And I want to track the element 'status' with a certain class.
Please explain how this can be achieved, or refer me to articles that have an example to
this kind of events, not only to general walkthroughs.
Many many thanks!
Let's start with the last one.
1) What you have to do it to create a link click listener (new tag-->tag type-->Link click listener) and run it on all the pages (or only the pages where it is relevant). This will generate an event for GoogleTagManager that you an use in a rule.
2) Create a rule like the following. This will trigger an event that we will do in the next stage
3) Set an event like the following. Note that I added an element id. If you have more than one toggle open link, you need to find a way how to distinguish between them on google analytics. ID could help you. Also note that using gtm you can only use the classes, not one specific class. (as far as I know)
Now let's go back to the first one. You can use the same method used here above, but instead of putting the {{element classes} as the value of the event, you can create a new macro that will employ the inner text of that link (gtm.element.innertext). On how to do it, read here: http://www.swellpath.com/2013/10/google-tag-manager-inspecting-andconfiguring-auto-event-tracking/
For the second one, you need the innertext of a third level parent. I'm not sure how to implement it other than using javascript that will call an event through the data layer.
So I would suggest a solution like the following:
Create an event on GTM that listens to events that are pushed via the data layer.
On how to do this, go to this post: http://moz.com/ugc/tracking-google-analytics-events-with-google-tag-manager
Start with "Tracking Google Analytics Events with GTM: The Second Way" and do steps: 1,2 and 3.
Create javascript code that is executed when the link is clicked. This JS will take the text of that 3rd parent element whenever that link is clicked. Again, I suggest to provide IDs so the task will be easier.
Then, the same JS code should then run this code
dataLayer.push({ 'event':'GAevent', 'eventCategory':'Navigation Clicks', 'eventAction':'Menu Item Click', 'eventLabel':'Outbound Click', 'eventValue:***YOUR 3RD LEVEL PARENT TEXT HERE***});
Then the event with the value is registered via google analytics.
Note that all the names I gave for the event values in my reply are based on my understanding of your needs. You will need to adjust them to what you want to achieve with this event tracking.

How to get AppointmentID on a buttonclick

I have created an outlook add-in where i have a ribbon that adds a button to the appointment tab. This button has a callback method that opens IE and goes to a specific page.
What i need: When you create an appointmnet and ID is stored somewhere(i assume).
I need to get the ID of the appointment that i have opend when i click on my button.
Simplify:
click on an appointment----->appointmnet has a costom button---->click the button--->open a page with the appointmentID.
I need to get the ID and add it to the url paramater when i open the page.
I have been reading up on the appointment global ID here:
http://msdn.microsoft.com/en-us/library/office/ff863645.aspx
And all the links that follow that article but I have not found anything that can help.
Im glad i have friends who know this better than me...
soloution here:
Outlook Ribbon Load Inspector.CurrentItem is null

selenium dynamic value - for textbox

I am in the middle of building a test case, where i came across this problem. In my web page there exists a search text box. I have recorded the web page using selenium ide.
type | id=search_input_char_name_136 | myproduct // textbox for search
click | css=button.oe_button | - // search icon click
I got the above code by recording, here in "type" action an id value is show for textbox, when i use the same value while testing, id not found error occurs. so i have recorded the action again and i found id is dynamic. for each time the id keeps on changing.
i have googled it and found xpath will be solution for this. i am very new to selenium and xpath. i couldn't figure out the solution. so help to slove this.. provide me the xpath syntax to type=id of search-textbox.
In the selenium IDE itself, after the recording is finished, try to click the drop down named Target in the IDe window for this textbox. There, in that drop down, you can get various locators like xpath, name, css, dom etc. Observe, which one is static for all the recordings and use that locator. Hope it helps. Let me know if you are still struck with this issue.

Resources