Related pages: |
This page describe how to create a synthetic job and view the results.
Before you create a Synthetic Job with a custom script, you will need to write a Python WebDriver script and get it working locally. For a good introduction to scripting, recommends reading the Selenium Python Bindings documentation.
Before running your scripts in Synthetic Jobs, recommends reading the differences between Python and synthetic scripts as you may need to make some modifications.
For a full-fledged script recorder, use the Firefox add-on Katalon Recorder (Selenium IDE for Firefox 55+). The resulting script will work with Browser Synthetic, but as with most auto-generated code, expect to make manual changes to improve it.
driver.get
should always point to a proper HTML page and not to resources.
|
Testing scripts locally is one of the best ways to take advantage of utilities to help you write scripts and then run them locally. To run scripts locally, complete the installation instructions given in the Selenium Python Bindings documentation and then run the script as you would any Python script.
When you are ready to write synthetic scripts, you should be aware that although Browser Synthetic can run unmodified Python scripts, there are few differences:
The driver initialization code can be removed because the variable driver
is automatically created and initialized with the browser selected in the Job creation UI. Thus, the example code below that initializes a driver would be replaced by our logic that then returns the variable driver
.
# This initialization code or any initialization code # will be replaced with Synthetic Monitoring logic, and # the singleton `driver` will be available. from selenium import webdriver driver = webdriver.Firefox() |
If your script initializes a driver, it is okay to keep it: Synthetic will just ignore your initialized driver and instead return the driver it automatically created. |
Once you have completed and tested your scripts, the next step is to create a Synthetic Job with your script:
All date and time functions in the synthetic script return time in the UTC time zone. For example, if a script is scheduled on July 30 at 12am PST from the San Francisco location, and in the script it calls the following function:
import datetime ..... dt = datetime.datetime.now() print(str(dt)) |
It will return the time as:
2020-07-30 07:00:00.000000 |
You have two types of views for the results. From the Jobs page, where you create a job, you can see your job and a summary of the results after the job has been run for both Synthetic Hosted/Private Agents.
You can also see more detailed results from the Sessions page. You can get there by either double-clicking your job or by clicking Sessions in the left navigation bar.
To see the metrics as charts, click the Charts tab:
From the Records tab, you can double-click a session to view the Session Details dialog: