I have a custom field where I would like to know what the value was at the time the user clicked into the field. This is what I added to the snapshot:
input.text[type="text"][name="ctl00$MainContent$txt_cust_field_name"]#txt_cust_field_name
I have a custom field where I would like to know what the value was at the time the user clicked into the field. This is what I added to the snapshot:
input.text[type="text"][name="ctl00$MainContent$txt_cust_field_name"]#txt_cust_field_name
Hey
Wildcards in events: you can use the wildcard *
character to stand in for any portion of the selector when defining an event. This is commonly used for filling in unique parts of a path like /app/env/*/definitions
where the wildcard stands in for everyone’s unique Heap environment id. Other use cases are for accommodating libraries that add random and periodically changing text to the end of classes, so you might define a click event on an element with class .profileName-fr56yh
as .profileName-*
. Snapshots will work with events defined like this.
Wildcards in Snapshots: If you need to wildcard part of your Snapshot, you can do this, but not in exactly the same way. Returning to the click example above, that won’t work in the Snapshot as it is not a valid JavaScript selector. (Even if you’re not using the JavaScript option, it is converted to JavaScript under the hood.) Instead, you would take an approach similar to what we describe here on simplified regex and attributes. So a Snapshot to capture the value above would be written as [class^=profileName]
(class starts with profileName) or [class*=profileName]
(class contains profileName) depending on where it falls in the class list. The latter is generally the right approach, but it depends on the markup.
Does that help?
If you’re having specific issues with capturing the data you want, it might be worth contacting support@heap.io where you can share more detail without risking sharing data that might be inappropriate for this forum.
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.