AppDynamics Knowledge Base

How to test Synthetic scripts on a local environment outside AppDynamics

How to test Synthetic scripts on a local environment outside AppDynamics

The below script can be used to find out the current environment component versions, be it AppDynamics synth environment or local environment:

import selenium
import platform
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--incognito")
chrome_options.add_argument("headless")

driver = webdriver.Chrome(executable_path="<CHROME_DRIVER_PATH>", options=chrome_options)

print ("\n*** Python, Selenium & Browser Details ***\n")

print("Python Version: %s\n" % (platform.python_version()))

print ("Selenium Webdriver Version: %s" % (webdriver.__version__))

print ("Selenium Client Version: %s\n" % (selenium.__version__ ))

print ("Browser Name: %s" %(driver.capabilities['browserName']))

print ("Browser Version: %s \n" %(driver.capabilities['browserVersion']))
 

NOTE: <CHROME_DRIVER_PATH> is the absolute path to the downloaded chrome driver such as "/Users/kumars2/chrome-version/v132.0.6834.83/chromedriver"

 

Sample: 

SaaS Synthetic Hosted Agent uses below versions of Browser & Selenium as of today (5/2/2025):

Python Version:

3.12.8

Selenium Webdriver Version: 

4.9.1

Selenium Client Version: 

4.9.1

Browser Name:

Chrome

Browser Version :

132.0.6834.83

 

Follow below steps, to get the chrome driver and browser binary:

1. Head to https://googlechromelabs.github.io/chrome-for-testing/

2. Download both the binary for chrome and chrome-driver from above URL based on your Platform/OS by replacing the desired Chrome <VERSION>  you want to test the scripts.

  • Example:
    • For Apple Silicon "M" chips MacBook, you can use below link to download chrome driver and browser binary.
    • "mac-arm64" for Apple Silicon [M1/M2…] MacBook and "mac-x64" for Intel MacBook or any other available platforms.

https://storage.googleapis.com/chrome-for-testing-public/<VERSION>/mac-arm64/chromedriver-mac-arm64.zip 

https://storage.googleapis.com/chrome-for-testing-public/<VERSION>/mac-arm64/chrome-mac-arm64.zip 

3. Unpack both the downloaded zips (browser and driver binary) to a single directory and use it as the <CHROME_DRIVER_PATH> in the above script.

Note: Based on OS machine you may need to fix executable by running command given in below article -

https://stackoverflow.com/questions/77099890/unable-to-update-chromedriver-since-chrome-for-testing-...

 

Linux:
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/linux64/chrome-linux64.zip
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/linux64/chromedriver-linux64.zip
 
MacBook Apple Silicon CPUs ("M" chips like M1/M2 etc.):
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/mac-arm64/chrome-mac-arm64.zip
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/mac-arm64/chromedriver-mac-arm64.zip
 
MacBook Intel CPUs:
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/mac-x64/chrome-mac-x64.zip
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/mac-x64/chromedriver-mac-x64.zip
 
Windows 32Bit OS:
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/win32/chrome-win32.zip
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/win32/chromedriver-win32.zip
 
Windows 64Bit OS:
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/win64/chrome-win64.zip
https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/win64/chromedriver-win64.zip
 

Reference link to install selenium: https://pypi.org/project/selenium/4.9.1/

 

After installing the right binaries for testing, the below screenshot is the output of the above script from one of the local environments (mac machine):

Screenshot 2025-05-02 at 4.31.31 PM.png

 

NOTE:  If the script works fine in your local environment but AppDynamics synthetic jobs are still facing an issue, please open a case with the support team. Please attach your script with test credentials, if any, for us to review/test it from our end.

Labels (1)
Tags (1)
Version history
Last update:
‎05-06-2025 02:02 PM
Updated by:
Contributors