Germain allows 1)faster recording of Selenium Script (with Germain RPA BOT Recorder 2) significantly easier management of Selenium script when deployed on thousands of servers (understand which is running, what version, remote upgrade of a script, etc)
Selenium script allows proactive detection of failing user scenario, and can run against most web application.
Common use cases:
Automatic and recurring login on a eCommerce, with automatic login failure detection.
Automatic and recurring check that a web page is accessible
Germain also supports Synthetic scripts in a headless environment.
How-to
Prerequisite
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)
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 11only, 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 isHKEY_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_BFCACHEsubkey may or may not be present, and should be created if it is not present.Important:Inside this key, create a DWORD value namediexplore.exewith the value of 0.
Record Synthetic User 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
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
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 User 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.
// 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();
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);