cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Joe.Catera
AppDynamics Team

Table of Contents

See also Synthetic Scripts FAQ (Part II).

 

General

What’s the best and easiest way to create a script?

Start with the Firefox add-on Katalon Recorder. You will probably have to modify the script it generates, but WebDriver is simple. You can also use the Katalon Recorder to test your script locally and make sure it works.  Here are some other bits of advice:

  • Assume you will have to clean up any auto-generated code, although the generated script will work without modifications.
  • Test the script locally before uploading it to our system.

 

Who are our hosting providers?

We use Amazon EC2 and SoftLayer. Other providers are being considered.

 

Why do agents sometimes appear slower than my local setup that uses WebDriver?

There are several reasons why the agents may be slower than on your laptop:

  • If the website you are hitting is close to you, an agent that's 10,000 miles away will be slower. That's the whole point of the global agent network!
  • We clear all relevant caches on the agent machines before running the tests.
  • If you enable traffic shaping, it will be slower.
  • We use 1 GHz, 4GB RAM Windows VMs. These are probably less powerful than your laptop, but the effect is probably small because most sites are not CPU or memory bound.
  • We wait a little longer to make sure pages have loaded fully to capture performance metrics. Generally, the effect is small, but, in extreme cases, the effect may be bigger.

Our primary goal is to provide consistent performance in a given location. Between locations, we try to keep everything consistent except the network.

When in doubt, run several sessions from the same location to confirm that the session duration is stable, and do the same from a different location to compare the results.

 

What do I do about confirmation emails or OTP keys?

We don't have special support at this time, but if you can write Python code to do something using the standard libraries, you can do that in your script. 

 

How do I handle an alert pop-up window?

One way would be to use a try-catch clause and wait for an alert as shown below:

 

 

 

from selenium.common.exceptions import TimeoutException
# Handle an alert pop-up
try:
WebDriverWait(driver, 2).until(EC.alert_is_present())
alert = driver.switch_to_alert()
alert.accept()
#print "alert accepted"
except TimeoutException:
print 'No alert pop-up'

 

 

How do I handle file uploads/downloads with WebDriver?

For file uploads, you need to either download a file or generate one in your script (we have no way of letting you upload things to the sandbox at the moment). Next, set the path of the input element to the absolute path of the file to upload.

Below is a working example that uploads a generated file with random content to https://encodable.com/uploaddemo/:

 

import random
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
import time
 
driver.implicitly_wait(10)
 
# Generate a file with random numbers
generated_file_name = "/tmp/generatedfile.txt"
with open(generated_file_name, "w") as generated_file:
  for _ in range(500):
    generated_file.write(str(random.randint(0,9)))

driver.get("https://encodable.com/uploaddemo/")

driver.find_element_by_css_selector("input.upform_field.file.required") \
 .send_keys(generated_file_name)
 
driver.find_element_by_css_selector("#uploadbutton") \
 .click();
 
# Wait for "Your upload is complete" text to show up
upload_complete = WebDriverWait(driver, 10).until(
 EC.presence_of_element_located((By.CSS_SELECTOR, "dt.first")))
 
# Check that things worked as expected"
assert upload_complete.text == "Your upload is complete:"
 
txt=driver.find_element_by_xpath("//dt[contains(text(),'Your upload is complete:')]")
print(txt.text)

 

 

As far as downloading files, you can definitely get the browser to download something, but from there you won't able to inspect the downloaded file from your script because we have no way to extract this file from the agent to the sandbox.

 

How do you ensure isolation between scripts/tests?

Each script is executed in a Docker container created and destroyed for each run. The script connects to a Windows agent to drive its web browser. For isolation, we clear the browser caches, history, and DNS cache between runs.

In both cases, we don't write to the disk, so if a hacker could steal a disk from the data centers we use, they might be able to recover something, but this would be a very sophisticated and expensive attack.

 

We baseline visual time/job time metrics—so will we baseline synthetic times by GEO as well?  The use case is that baseline response-times per-GEO could vary.

We don't baseline per job per GEO currently. We do baseline the overall page times per GEO alongside the current RUM metrics.

 

Can a maintenance window be scheduled to disable jobs on a regular schedule (for maintenance windows for instance)?

You can't schedule a maintenance window per se, but if you know when your maintenance windows are going to be scheduled, then you can set up your schedules so that no jobs will be executed during that window. Alternatively, if you don't know ahead of time when the maintenance windows are going to be scheduled, you can always go in manually and hit the Disable button on the jobs before the maintenance starts and then re-enable them afterward.

 

How can I set the screen size for my Synthetic Job? 

You can set the height and width of the browser window using the set_window_size(width, height, windowHandle='current') method. For example, if you want to set the window size to 800x600 pixels, insert this method into your Synthetic Script:

 

driver.set_window_size(800,600)

 

Back to the top


 

Alerts

Do you alert immediately when a page crosses a performance threshold?

We give the options of alerting after a retry that is also over the threshold, immediate alert with no retry and alerting after n measurements are over the threshold.

 

How are performance alert thresholds applied to scripts with multiple pages?

Each page is analyzed individually. If any of them is over the threshold, the alert is generated.

 

Do you confirm site availability warnings and errors before alerting?

We do confirm a warning and error when detected. We generate events, however, at every state: issue detected, confirmed, ongoing, and cleared, and give you the option of being notified of events you care about.

Back to the top

 


 

Availability and Location

How many locations do you offer?

We currently have 27 locations, and we’ll be adding more based on customer demand. Using the public cloud lets us deploy anywhere we can find a good cloud provider.

 

How is availability computed? What does "ppm" or "parts-per-million" mean?

Availability (parts-per-million) is computed as: (# succeeded / # attempted) * 1,000,000 and represented in per million, instead of percent, because controller metrics are always integer-valued. If we had used percent, the most precise availability we could represent would be 100%, 99%, 98%. Not, for example, 99.99%.

To convert per-million to percent, just divide by 10,000. For example, if the availability (ppm) is 999,800, then the availability (%) is 99.98.

 

Most screens convert to percent before showing, but "raw data" screens like the metric browser show the value per-million.

 

To test internal applications from external locations, can we provide a list of AWS IP/Port information so they can allow these through their firewalls?

We offer three locations with static IPs that you can use to test internal applications from external locations.

Back to the top


 

Browsers

What are the browser versions for Firefox and Chrome?

Firefox runs version 41.0.1, and Chrome runs version 48 (updated on 2017-03-09). Please note that browser versions are subject to change in the future.

 

How often do you update the browsers that you support?

Browser versions are generally locked; however, we can upgrade within 1-2 weeks as required.

 

Is BSM an option for monitoring browser extensions like Flash or Silverlight?

Browser extensions like Flash and Silverlight (which are being phased out) can't be monitored by stock Selenium, which is what we support. Many in the community have extended Selenium with APIs to do this.

 

We don't currently support the use of 3rd-party libraries in our runtime.

Back to the top


 

Environments

What scripting environments are supported?

  • Python  v.2.7.x. (Python v3 is not supported yet.) Python scripts < 2.7 are likely to work, but are untested.
  • Selenium: We support WebDriver, which is also sometimes known as Selenium 3. The scripts should be written using the Python WebDriver API.
  • We use a custom version of the Selenium Server based on version 3.0.1. Note, this is subject to change without notice.

 

What hardware is used to run the tests in browsers? 

Browser tests are run on single-core VMs with 4 GB of RAM, although the hardware may vary slightly per location. To ensure consistent performance results, the VMs only run one job at a time.

Back to the top


 

Languages and Libraries

Can Selenium scripts are written in Java be converted to Python for synthetic jobs?

No. There isn't a standard accepted tool that would do that, and honestly, this is just a bad idea. These scripts do have a maintenance cost, and a pure machine conversion between two languages is just going to make this more difficult. Not to mention debugging in the first place, unless things work out of the box, which is not very likely, the machine translation is going to be really hard to debug. 

 

What Python libraries can I use in my scripts?

You can use any library that is part of the standard distribution of Python 2.7. In addition, the following libraries are available:

 

Can I install my own libraries to support my scripts?

Not yet.

Back to the top


 

Limitations and Restrictions

Do we impose any kind of object size limits for test scripts?

There are no size limits for test scripts.  Please be aware, however, that larger files will use more time (more "expensive").

Back to the top


 

Mobile Synthetics

Do we have a timeframe for mobile synthetics?

We do not have a timeframe for mobile yet.

Back to the top

 

Comments
bhunesh.R
Producer

Synthetic Private agent installation issue.

 
Hi team , we have installed the synthetic agent in SaaS however same unable to connect.
 
Can you please help where we see the below steps as i logged in SaaS and cant find it.
 

Confirm the Installation Was Successful

  1. Go to your SaaS Controller and to the Synthetic Job List.
  2. Click Create a Job.
  3. From Choose Locations, select Private from the dropdown to view all the Synthetic Private Agents associated with your account.
  4. Verify that your private location shows up as one of the available locations.
 
Please help on the above steps
 
Bhunesh
Justin.Vander Ziel
Adventurer

Hi folks,

 

We would like to exclude Synthetic Jobs from our Web Analytics. Which IPs and/or user agent names are used?

 

~ Justin

Claudia.Landivar
AppDynamics Team (Retired)

Hello, @Justin.Vander Ziel 

 

Would this Knowledge Base article help? What static IP addresses does AppDynamics use for Synthetic? It's been very recently revised.

 

Please let us know if it answers your needs and, if it doesn't, what's missing.

 

Claudia Landivar

Community Manager & Editor

Justin.Vander Ziel
Adventurer

Hi Claudia,

 

Thanks for the response.

 

According to the documentation, "There are two deployment types for Synthetic Agents

  • Synthetic Hosted Agents: AppDynamics hosts these Synthetic Agents. This deployment is recommended for testing public websites. 
  • Synthetic Private Agents: You install and host Synthetic Agents on your machines. This enables you to test internal sites and services.

I believe that the list you pointed out is for the latter deployment type. We are currently using Synthetic Hosted Agents to test via Selenium scripts our public websites. We would like to exclude the testing done via these Synthetic Jobs from our (Adobe) analytics. 

 

Justin

 

The idea of "using AppDynamics Synthetic hosted Agents with your private sites or applications" for which they provide the set of static IPs is very interesting and one about which I am interested in learning more. However, I don't think that list of IP addresses is the one I seek.  

Mayuresh.Kshirsagar
AppDynamics Team (Retired)

Hi @Justin.Vander Ziel,

 

Regarding:

We would like to exclude Synthetic Jobs from our Web Analytics. Which IPs and/or user agent names are used?

 

The Synthetic Traffic should be ignored by Real User Monitoring, and hence it should not be reported into Analytics under Browser Records.

 

Are you seeing the synthetic records when searching in Browser Records under Analytics?

 

Regards,

Mayuresh

Julian.Oxley
Adventurer

Hey Hey! 

 

Does anyone have any thoughts on how/why scripts using the Python requests module don't don't correlate to APM snapshots? If we take the example below we see a Session for a script with only Python requests no Selenium and no Waterfall, Resources, Business Transactions or Screenshots (Screenshots I can understand ;).

Session.PNG

But, we know from the script output this call is for an account with the APM snapshot below.

error.PNG

 

So, wouldn't it be swell if the Session showed the correlated snapshot..

 

snapshot.PNG

 

Julian.Oxley
Adventurer

To answer my own comment above its because the ADRUM javascript is injected into the instrumented website to correlate with APM. So, that being the case how can we correlate to APM if there isn't the ADRUM beacons gluing session and snapshot together? What would I have to include in my script to simulate those headers/cookies?

Mayuresh.Kshirsagar
AppDynamics Team (Retired)

Hi Julian,

 

You don't really need ADRUM/Javascript Agent to correlate. You need the App Agent (Java, .NET, etc) to be instrumenting your backend, and you need to enable the correlation as described at https://docs.appdynamics.com/display/PRO45/Correlate+Business+Transactions+for+EUM+Monitoring

 

If the correlation headers/cookies reach the synthetic agent running the tests, you should have correlation working. You can inspect the response headers to see if there were correlation headers showing up or no:

Sessions_-_AppDynamics.png

They are named with the prefix ADRUM_*.

Let me know if this helps.

Version history
Last update:
‎07-27-2023 10:06 PM
Updated by:
On-Demand Webinar
Discover new Splunk integrations and AI innovations for Cisco AppDynamics.


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here