Context
The sitedriver is a powerful feature, allowing you to execute scenarios. From your landing page you can assign a scenario to an element to execute a sequence when a user clicks on it.
How to find the sitedriver?
The sitedriver can be found on the instance settings, from the homepage
How to use the sitedriver?
Requirements
You can freely create scenarios on the sitedriver. However some actions have to be done on the tech team side to “bind” each scenario to a button.
Structure
The sitedriver is composed of:
A scenario, a sequence of actions and mostly bind to an element of the landing page. When a user clicks on this element he will be redirected to the original page and the sitedriver will execute the bound scenario
An action, an event or a function who will be executed.There are many kind of events or functions allowing to have full customization over the scenario
A name, as the the sitedriver can have many scenarios we used a name to bind the sequence to an element to know which part we need to execute
Actions
An action can have many functions here is the list of actions type:
clickElement
Allow the sitedriver to click to a selected element
waitElement
Event where the sitedriver wait to a selected element to be present on the page before going to the next action
waitDuration
Event where the sitedriver wait during a given time before going to the next action
waitDOMReady
Event where the sitedriver wait to the DOM to be ready before going to the next action
waitWindowLoaded
Event where the sitedriver wait to the window to be fully loaded before going to the next action
customFunction
Custom Javascript function added by the user and executed during the action
waitCondition
Event where the sitedriver wait for a condition to be true before going to the next action
displayLoader
Display a loader during a given time. A message and a color can be added
hideLoader
Hide a loader lastly created by displayLoader
In addition there are small features present to help:
searchParams
A function to retrieve a variable from an URL parameter (used for waitCondition or customFunction)
Next steps
Once all your scenarios are created the next step is to generate a script and add it on the Scripts menu. To generate a script, on the sitedriver page, click on “Preview script (prod)”.
A modal will open, displaying a script you can copy
Use this script on the Scripts menu to generate a link to give to the client (c.f. Article Scripts)
Debug
There are many ways to debug the sitedriver in case of issues
URL parameters
Before testing it’s important to know about the url parameters from an element bound to a scenario.
Here is an example of URL parameters from an add to cart button link
XXXXX?lpo-basket=add&lpo-transaction=32121&lpo-qty=4&lpo-size=M
lpo-basket=add
The default parameter for the site driver allowing to execute the scenario named “add”
lpo-transaction=32121
A unique identifier allowing to execute once the sitedriver. If a user refresh the page with the same parameters the scenario won’t be executed
lpo-qty=4
An informative parameter allowing the sitedriver to select the right quantity before adding to cart
lpo-size=M
An informative parameter allowing the sitedriver to select the right size before adding to card
Web console
Through the console the sitedriver also send messages about the states of the scenario
Sitedriver tests
A button to simulate your scenario through a bot and executing the actions