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 (smile) ) 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

Firefox

Microsoft Edge

Microsoft Internet Explorer

  • 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 is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. Please note that the FEATURE_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 named iexplore.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!

  1. Log on to germainAPM
  2. Left Menu > Automation > Click
  3. Start recording by clicking on "Record (with click recorder)" menu item
     
    Notes: 
    1. You have already installed our extension - it will open our germainAPM Click Recorder extension as a popup window
    2. 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
  4. Go to your web app and manually perform the user scenario you want to be recorded
  5. Stop recording (at this point, germainAPM has recorded the manual user scenario you just did) 
  6. Export collected recording :
    1. You have germainAPM dashboard still opened in one of your browser's tab - this will populate "Click" wizard which will open up automatically
    2. 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
  7. 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.
  8. Select Portlet where the data will be displayed. This step can be skipped.
  9. Select which dashboard to add the Portlet from previous step
  10. Deploy scenario component
    1. Select browser from dropdown
    2. Provide path to the driver (e.g.  /usr/bin/chromedriver)
    3. Select the Monitoring Node and Engine on which this script will run
    4. Set schedule for how frequently it will run
    5. After clicking finish, script will be deployed

Example: https://vimeo.com/user90465177/review/478582314/7a86810bba

2. via Import 

  1. Log on to germainAPM
  2. Left Menu > Automation > Click
  3. Import by clicking on "Import (from click recorder)" menu item
     
  4. Set name and application name for Synthetic scenario.
  5. Import previously recorded results
  6. 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.
  7. Select Portlet where the data will be displayed. This step can be skipped.
  8. Select which dashboard to add the Portlet from previous step
  9. Deploy scenario component
    1. Select browser from dropdown
    2. Provide path to the driver (e.g.  /usr/bin/chromedriver)
    3. Select the Monitoring Node and Engine on which this script will run
    4. Set schedule for how frequently it will run
    5. After clicking finish, script will be deployed

3. via Rule 

  1. Log on to germainAPM
  2. Left Menu > Automation > Click
  3. Write custom rule by clicking on "Custom (Rule)" menu item
  4. Set name and application name for Synthetic scenario.
  5. 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.
  6. 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.
  7. Select Portlet where the data will be displayed. This step can be skipped.
  8. Select which dashboard to add the Portlet from previous step
  9. Deploy scenario component
    1. Select browser from dropdown
    2. Provide path to the driver (e.g.  /usr/bin/chromedriver)
    3. Select the Monitoring Node and Engine on which this script will run
    4. Set schedule for how frequently it will run
    5. 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