Record a Synthetic Scenario
Prerequisites
Supported browser (Chrome, Firefox, Edge or Internet Explorer) is installed on the Germain engine server
Compatible driver is available and accessible by Germain 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 - Google Chrome in a headless environment
Firefox
Version selection guide: https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html
Guide for setting up Firefox can be found here - Firefox in a headless environment
Microsoft Edge
Microsoft Edge drivers location: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads
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.
Record Synthetic Scenario via Germain BPA Bot Recorder
The easiest way! in 2 minutes you can have a synthetic user scenario recorded and running 24x7 against your app!
Germain Workspace > 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 Germain Click Recorder extension as a popup window
You have not installed our extension yet, download Germain UX - RPA Bot Recorder
(it will open new tab where you can download it from Google Chrome Store)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, Germain has recorded the manual user scenario you just did)
Export collected recording
:
You have Germain dashboard still opened in one of your browser's tab - this will populate "Click" wizard which will open up automatically
Your Germain 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
Deploy Germain RPA BOT Recorder
How-to-use Germain RPA Bot Recorder
(2-min video) https://vimeo.com/user90465177/review/478582314/7a86810bba
Record Synthetic Scenario via Script Import
Germain Workspace > 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
Record Synthetic Scenario Via Rule
Germain Workspace > 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 Germain dashboard still opened in one of your browser's tab - this will populate "Click" wizard which will open up automatically
Your Germain 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:
<html lang="en">
<body>
<form>
<input type="text" name="UserName"/>
<input type="password" name="Password"/>
<button type="submit" id="Login">Login</button>
</form>
</body>
</html>
Click Rule:
// Search for username / password input and fill the inputs / click Login button
driver.findElement(By.xpath("//input[@name='UserName']")).sendKeys("USERNAME");
driver.findElement(By.xpath("//input[@name='Password']")).sendKeys("PASSWORD");
driver.findElement(By.id("Login")).click();
Keyboard action
// Simulate CTRL+SHIFT+x keys
String logout = Keys.chord(Keys.CONTROL, Keys.SHIFT, "x");
driver.findElement(By.tagName("html")).sendKeys(logout);
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
// scroll browser window to the top
js.executeScript("window.scrollBy(0,0)");
// find first button element and click it
WebElement el = driver.findElement(By.xpath("/html/body/button[0]"));
js.executeScript("arguments[0].click();", el);
Catch a failure
Trying to capture an Exception/failure in a Synthetic scenario using Mvel won’t work (it is not supported):
try {
wait.until(ExpectedConditions.elementToBeClickable(By.partialLinkText("Find Customer")));
wait.until(ExpectedConditions.not(ExpectedConditions.presenceOfAllElementsLocatedBy(By.className("siebui-busy"))));
log.info("**************************************************try****************");
} (Exception ex){
log.info("**************************************************catch****************");
}
In more recent version of Germain, you can create these selenium scripts in Javascript (instead of Mvel):
Full script
Explanation
synthetic_scenario_script_guide.txt
Detect PDF-opening related issue
Ability to proactively detect, in real-time, issues related to opening a PDF document (e.g. on/from http://salesforce.com): driver.getWindowsHandles
method to switch to another tab within a Selenium script.