JQuery selectors are used to locate elements in the HTML structure based on their characteristics such as id, class, type, attributes, or values of attributes. In this lesson we will learn when to use jQuery when implementing your WalkMe solution and look at some examples of how it is used.
While the WalkMe element selector tool is capable of consistently capturing and detecting elements on a site, there may be instances where you would need to use jQuery for your WalkMe implementation. Some of those instances may include, but are not limited to:
- Enhancing precision
- Optimizing performance
- Grabbing specific values
Some use cases of applying jQuery in relation to WalkMe are as follows:
Special Cases for Element Selectors
In certain scenarios, you may want to modify the precision of WalkMe's algorithm by using jQuery selectors to select On Screen Elements. These cases include:
- Selecting complex elements with low element grade
- Make a generic element selection (i.e. table/row or a set of different buttons)
The figure shows the special cases for element selectors.
Creating Goals for Onboarding Tasks and Smart Walk-Thrus
Since Onboarding Tasks are constantly being tracked by WalkMe, it is recommended to track elements by jQuery rather than the On-Screen element selector in order to optimize your site's performance.
Using Dynamic Text
Dynamic Text allows you to customize text used by WalkMe for different features. Dynamic text is based on end-user information, and it allows you to personalize a ShoutOut or balloon with a user’s name, or even change text that’s auto-filled for a user using an automated process. JQuery selectors can be an excellent choice to grab a value from a user variable or text on the screen and incorporate it into a dynamic announcement.
The figure shows popup step "Interaction".
Creating a Launcher or SmartTip with an Element Behavior Setting
When a Launcher or SmartTip is created with an Element Behavior setting enabled, it means WalkMe is constantly searching for that element.
This can potentially impact performance, especially if there are multiple Launchers or SmartTips with the setting enabled on the same page.
One way to combat performance issues is to use a well written jQuery selector to identify the Launcher's or SmartTip's element instead of the On-Screen Element selector.
The figure shows Test Launcher screen with Launcher option "Selected Element".