IBM APM 8.1 synthetic agent - troubleshooting synthetic transaction playback on SN agent
ericmtn 1000009W88 Visits (1103)
This blog is following other blog:
If you are encountering some unexpected errors while playing back selenium script / transaction on the synthetic agent with firefox browser, you can try and use the following procedure to isolate where the problem may resides. The following commands are similar to the one used "behind the scene" by the SN synthetic agent while playing back a selenium script.
Remark: on the SN agent host, start firefox browser manually, and access the targeted url involved in your script and transaction, so you simulate first the script steps / transactions, using firefox browser manually. If it's working, it's a good start, but not necessarily sufficient. why?
Because sn agent is using Selenium driver that is starting a new firefox profile and environment for each script playback. So this robotic firefox profile has settings that are different from a default firefox profile and what you get while using firefox browser manually is not necessarily what you get while SN agent is using a 'controlled' firefox browser.
A. on SN agent machine, make sure that synthetic sn agent is running, and that you are getting a new firefox profile which is used by SN agent to playback scripts; then copy over such firefox profile environment; you can get it from /tmp directory:
Use command like below to copy a firefox profile, when you get one listed in /tmp, example :
# cp -r /tmp
remark: replace rust
Note: the directory. e.g. /tmp
If you are using SN agent 8.1.4 IF5 or higher, the following file should have been installed in the crontab, as seen with below command:
$> crontab -e
* * * * * CAND
if you can not see new profile environment created in /tmp during/after selenium script playback, it's may be because the above program, in charge of cleaning up /tmp, does the job very quickly. So you may need to stop the cron tasks temporarily while you are applying these steps, using following command or similar:
$> /etc/init.d/cron stop
Once you get a firefox profile environment copied successfully, you can stop the SN agent, or leave it running, and then continue with steps below; don't forget to restart the cron tasks as well.
B. run below command to launch a firefox session which will use the same profile used by SN agent, input in firefox browser session the website url directly, and check if you can access your website successfully
$> firefox "-marionette" "-devtools" "-foreground" "-no-remote" "-profile" "/tmp/profile1"
Note: if step b failed, then it confirms that there is something wrong with the firefox profile used by Sn agent, so you can ignore other tests below; it's possible for example that the automated firefox browser detects a system proxy, and is trying to use it, while such system proxy is incorrectly defined in your environment...
C. if step B is successful, then you can check if Gecko driver can work well with below commands:
$> cd /opt
## playback one of your existing Selenium problematic script with below command, which will use Gecko to invoke firefox (you need apm sn agent 8.1.4 IF5 or above for that)
$> java -cp sele
Note: if step C failed, it confirms that there is something wrong with Gecko driver, and you can ignore other tests below
D: if step C is successful, then we can check if Selenium server can work well with below commands:
$> cd /opt
## playback one of your script with below command which will use selenium server --> gecko driver --> firefox to run the test:
$> java -cp sele
Conclusion: Review the results of above commands used. Provide the results of above commands to IBM support team, if needed, a part of the investigation.
also review the /opt
Subscribe and follow us for all the latest information directly on your social feeds: