Synthetic User Click Recorder (using Selenium)
Description
germain APM can be configured to record and execute Synthetic User Click/Scenario on any of your web application. germain APM also supports Synthetic automation scripts in a headless environment. This allows for testing the following use cases:
- Perform login action on any website
- Visit a webpage and capture required information
- Check every few minutes if web page is accessible or if it is offline
- More complex actions can be implemented depending on requirements
Download: germainAPM's Synthetic User Click Recorder
Example
2 minutes to record and execute a synthetic user scenario using germainAPM: video
Benefit
This new Synthetic Login mechanism is intended to be used for proactive monitoring of a production web application and allows you to detect user issue(s) before users use the application. This mechanism is better than HP Load Runner (or any other tool that can simulate users logging on to a web portal, yet this new mechanism isn't built to perform Load Test ) because it checks upon the actual HTML rendering, JS execution and HTTP responses, etc (HP Loadrunner only checks upon HTTP responses e.g. HP can detect if the "Welcome" message does not show up, but may not detect if a portion of a html page is missing or failing...HP may miss many production issues like this one, that users would typically be affected by)
Prerequisite
- Supported browser (Chrome, Firefox, Edge or Internet Explorer) is installed on the germain APM engine server
- Compatible driver is available and accessible by germaini APM engine server (e.g. if you want to execute your scenario on Chrome browser and installed Chrome's version is currently 73.0.3683.75 then you need a dedicated web driver compatible with Chrome 73; See below for details where to find correct driver)
Browser Settings and Web Driver Selection
Once correct driver selected, upload it to your GERMAIN_APM_ENGINE_ROOT/drivers folder and configure your driverPath to point to GERMAIN_APM_ENGINE_ROOT/drivers/EXECUTABLE_DRIVER_NAME.exe (you can also configure driverPath as a JVM argument for the engine under jvmOptions with a value: -Dwebdriver.chrome.driver=GERMAIN_APM_ENGINE_ROOT/drivers/EXECUTABLE_DRIVER_NAME.exe)
Chrome
- Chrome drivers location: http://chromedriver.chromium.org/downloads
- Version selection guide: http://chromedriver.chromium.org/downloads/version-selection
- Guide for setting up Chrome can be found here - Setting up Google Chrome in a headless environment
Firefox
- Gecko drivers location: https://github.com/mozilla/geckodriver/releases/tag/v0.28.0
- Version selection guide: https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html
- Guide for setting up Firefox can be found here - Setting up Firefox in a headless environment
Microsoft Edge
- Microsoft Edge drivers location: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads
- Version selection guide: https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium?tabs=c-sharp
Microsoft Internet Explorer
- Microsoft IE drivers location: https://selenium-release.storage.googleapis.com/index.html
- Version selection guide: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration
- Additional notes:
- You must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode".
- Additionally, "Enhanced Protected Mode" must be disabled for IE 10 and higher. This option is found in the Advanced tab of the Internet Options dialog.
- The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.
- For Windows 10, you also need to set "Change the size of text, apps, and other items" to 100% in display settings.
- For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. For 32-bit Windows installations, the key you must examine in the registry editor is
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
. For 64-bit Windows installations, the key isHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
. Please note that theFEATURE_BFCACHE
subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value namediexplore.exe
with the value of 0.
Three ways to Record Synthetic User Scenario
1. via Chrome Extension
The easiest way! in 2 minutes you can have a synthetic user scenario recorded and running 24x7 against your app!
- Log on to germainAPM
- Left Menu > Automation > Click
- Start recording by clicking on "Record (with click recorder)" menu item
Notes:- You have already installed our extension - it will open our germainAPM Click Recorder extension as a popup window
- You have not installed our extension yet - it will open new tab where you can download it (on Google Chrome Store - https://chrome.google.com/webstore/detail/germain-apm-click-recorde/ekefhegifhgjebglnmofomamoihpkkjb). Click one more time on the "Record (with click recorder)" to start recording
- Go to your web app and manually perform the user scenario you want to be recorded
- Stop recording (at this point, germainAPM has recorded the manual user scenario you just did)
- Export collected recording
- You have germainAPM dashboard still opened in one of your browser's tab - this will populate "Click" wizard which will open up automatically
- Your germainAPM dasshboard is closed - this will export your scenario to json file which you will be able to import into "Click" wizard later on using "Import (from click recorder)" menu option
: - Set time(in seconds) for SLA. This value is the acceptable duration that the entire scenario should take. If it takes longer than this, user can be alerted. This step can be skipped.
- Select Portlet where the data will be displayed. This step can be skipped.
- Select which dashboard to add the Portlet from previous step
- Deploy scenario component
- Select browser from dropdown
- Provide path to the driver (e.g. /usr/bin/chromedriver)
- Select the Monitoring Node and Engine on which this script will run
- Set schedule for how frequently it will run
- After clicking finish, script will be deployed
Example: https://vimeo.com/user90465177/review/478582314/7a86810bba
2. via Import
- Log on to germainAPM
- Left Menu > Automation > Click
- Import by clicking on "Import (from click recorder)" menu item
- Set name and application name for Synthetic scenario.
- Import previously recorded results
- Set time(in seconds) for SLA. This value is the acceptable duration that the entire scenario should take. If it takes longer than this, user can be alerted. This step can be skipped.
- Select Portlet where the data will be displayed. This step can be skipped.
- Select which dashboard to add the Portlet from previous step
- Deploy scenario component
- Select browser from dropdown
- Provide path to the driver (e.g. /usr/bin/chromedriver)
- Select the Monitoring Node and Engine on which this script will run
- Set schedule for how frequently it will run
- After clicking finish, script will be deployed
3. via Rule
- Log on to germainAPM
- Left Menu > Automation > Click
- Write custom rule by clicking on "Custom (Rule)" menu item
- Set name and application name for Synthetic scenario.
- Provide Java code using Selenium API to execute a click scenario - more details on Selenium API are available here: https://www.selenium.dev/documentation/en/. See few examples below.
- Set time(in seconds) for SLA. This value is the acceptable duration that the entire scenario should take. If it takes longer than this, user can be alerted. This step can be skipped.
- Select Portlet where the data will be displayed. This step can be skipped.
- Select which dashboard to add the Portlet from previous step
- Deploy scenario component
- Select browser from dropdown
- Provide path to the driver (e.g. /usr/bin/chromedriver)
- Select the Monitoring Node and Engine on which this script will run
- Set schedule for how frequently it will run
- After clicking finish, script will be deployed
Chrome Extension Features
Export
You can export current results via Export button
:- You have germainAPM dashboard still opened in one of your browser's tab - this will populate "Click" wizard which will open up automatically
- Your germainAPM dasshboard is closed - this will export your scenario to json file which you will be able to import into "Click" wizard later on using "Import (from click recorder)" menu option
Import
You can import previous click recorder results via Import button
and keep adding to it new results.Settings
You can set additional settings to customize your synthetic scenario recording and replay. Click Settings button
to set:- Selectors priority order
Synthetic scenario replay will always use first found selector from the priority order list (e.g. for websites which either don't guarantee unique element IDs or generate them dynamically select ID as lowest priority).
- xPath failback selection
Failback to xPath selector if element is not found using primary selector.
- Replay delay (in seconds)
Additional delay duration before replaying next event (click, change, ...). Very useful in case if your website uses some loaders/spinners/modal windows between clicks/navigations.
- Replay element timeout (in seconds)
Maximum element wait time applied to find it and execute an action against it (click, change, ...). If the scenario fails to find an element using first selector then, if 'Always failback to xPath selector' is set to true, it will retry to use element's xPath instead.
Examples
Form login using username and password
Page HTML:
Click Rule:
Keyboard action
Execute JavaScript code
Scroll and click executed programmatically (via JavaScript code)
Note: js instance is already available in the context of scenario execution therefore you shouldn't re-initiate it again