APM 8.1.4 synthetic agent - how to create synthetic transaction and play it back on SN agent?
ericmtn 1000009W88 Visits (504)
This blog shows by the example how to upload a selenium script to the APM 8.1 server, for later playback on synthetic player agent 8.1.4 (SN agent)
currently, when this blog was created, April 2019, latest version available are:
APM server 8.1.4 IF0008
SN agent 8.1.4 IF0005
SN agent 8.1.4 IF0005 supports only Selenium IDE v3.2 or v3.3 for Firefox browser, as documented here:
2) recording side:
From firefox browser, on your recorder machine, install Selenium IDE v3.2 or v3.3 add-on,
do not select latest version, but go to 'see all versions' :
and select for example version 3.3.1
so you end up with this :
above, CHANGE the automatic updates to ==> OFF
then record your script using Firefox and Selenium IDE:
you can click on the + button to create a new script, setup a name, record your script using the red button. once you recording is complete, play it back using the play arrow, make sure it's all ok. customize it if needed
Once it's good, create a new test suite, and add your script to a suite, then save that into a project.
Once you get a valid test into a suite and into a project, save it into a local .side file (.side = .Selenium IDE type of file), using the disquette button on top right corner of Selenium IDE UI.
Then you can access the APM server UI console -> System configuration -> Synthetic script Manager -> click the + button, to reach the "Synthetic Script Editor", and set up a Transaction Name of your choice
Then use the upload button to select your local <script>.side file saved earlier within Selenium IDE on your recorder machine.
make sure you have at least one sn synthetic agent up and running, so you can select an active Location to deploy the script
check in 'Advanced settings' tab that you are seeing the steps and transactions recorded previously in your script.
if all went smoothly, you should see that your transaction is now listed under Synthetic Script Manager, and status = started
Using Selenium IDE, if you have not added your test script in a test suite, but simply saved your script inside a project, without a test suite, then when you upload such project and .side file to the APM UI under Synthetic script manager, you can never save your new transaction.
And also, under the 'Advanced settings', you see only a "Loading" message, and the save button is never active. To correct this. go back into selenium IDE, and add your script to a test suite, save that test suite into a project, so your new .side file is updated. Then try again to create your transaction inside APM UI
3) Playback - Sn agent side:
after the new selenium script is deployed on the SN agent, you should see following message in SN agent log, when the script is scheduled to start...
check file :
Your script should have been pushed to the SN agent, under directory:
Each script has its own subdirectory, example:
If your script contains commands that the Selenium webdriver or Gecko (used for playback) doesn't recognize, the playback fails, and error like this is reported in same ksn_trace0.log
No such command
To fix that, you need to adapt your script with command supported by webdriver / gecko. see useful blogs:
Other remark: to get support for selenium script, refer to :
Other useful blogs or articles:
If your synthetic transaction doesn't appear on the APM UI as expected under Application Dashboard-> Applications -> All my Applications -> My Transactions -> "Synthetic Transactions", here are a few tips:
- check on APM server the SCR log file : /o
[and if needed older log scrserver.log.* e.g. scrserver.log.1, .log.2 etc]
search for the line like below:
12 Apr 2019 13:52:26,301 INFO [ScrParmBlock] ScrOslcRequest - Duration: 23ms, Method: GET, URL: htt
The number displayed after the count string (e.g. 7) should match the number of synthetic transactions displayed in APM UI in "Synthetic Transactions"
If there is a mismatch, then check if you see any ERROR message in scrserver.log file
When Synthetic scripts are uploaded and distributed by Synthetic Script Manager UI, the UI creates Synt
If you find ERROR message, then collect and send to IBM support such scrserver.log file for next review.
Also, run the following queries from a browser tab and provide the responses:
If your synthetic script playback is not working as expected, you may benefit from using this method for further troubleshooting:
stop the synthetic agent : /opt
enable screen capture : export ENAB
(so you set up the environment variable to enable screenshot captures during playbacks)
start the agent : /o
The screenshot .png files will be saved into /opt
This method is only to be used for debugging purpose, turn it off by using
and restart the SN agent, once finished debugging, since that screenshot capture will impact the performance of SN agent.
D-Bus is an IPC mechanism initially designed to replace the software component communications systems used by the GNOME and KDE Linux desktop environments (CORBA and DCOP respectively). see:
Firefox is dependent on DBUS, so if you installed Firefox with 'yum install' or 'apt-get install' commands for example, it will automatically install DBUS, if it's not installed yet. Firefox is a prerequisite of synthetic agent, but we'll not document that dependencies of Firefox are prerequisite of synthetic agent. Customer should install Firefox and its dependencies correctly.
So it's also recommended to check on SN agent system if you have
For reference, on my own SN agent host, I have this:
[root@snagent26 ~]# cd /usr/bin
[root@snagent26 bin]# ls -al dbus*
-rwxr-xr-x 1 root root 90000 Feb 20 2013 dbus-binding-tool
-rwxr-xr-x 1 root root 31944 Apr 5 2018 dbus-launch
-rwxr-xr-x 1 root root 36928 Dec 8 2009 dbusxx-introspect
-rwxr-xr-x 1 root root 104824 Dec 8 2009 dbusxx-xml2cpp
[root@snagent26 bin]# ls -al dbus-launch
-rwxr-xr-x 1 root root 31944 Apr 5 2018 dbus-launch
Subscribe and follow us for all the latest information directly on your social feeds: